Module: DevinApi::Endpoints::Sessions

Defined in:
lib/devin_api/endpoints/sessions.rb

Overview

Sessions endpoints for the Devin API

Instance Method Summary collapse

Instance Method Details

#create_session(params = {}) ⇒ Hash

Create a new session

Parameters:

  • params (Hash) (defaults to: {})

    Body parameters

Options Hash (params):

  • :prompt (String)

    The task description for Devin (required)

  • :snapshot_id (String, nil)

    ID of a machine snapshot to use

  • :unlisted (Boolean, nil)

    Whether the session should be unlisted

  • :idempotent (Boolean, nil)

    Enable idempotent session creation

  • :max_acu_limit (Integer, nil)

    Maximum ACU limit for the session

  • :secret_ids (Array<String>, nil)

    Array of secret IDs to use. If nil, use all secrets. If empty array, use no secrets.

  • :knowledge_ids (Array<String>, nil)

    Array of knowledge IDs to use. If nil, use all knowledge. If empty array, use no knowledge.

  • :tags (Array<String>, nil)

    Array of tags to add to the session.

  • :title (String, nil)

    Custom title for the session. If nil, a title will be generated automatically.

Returns:

  • (Hash)

    Response body

See Also:



33
34
35
# File 'lib/devin_api/endpoints/sessions.rb', line 33

def create_session(params = {})
  post('/v1/sessions', params)
end

#list_sessions(params = {}) ⇒ Hash

List all sessions

Parameters:

  • params (Hash) (defaults to: {})

    Query parameters

Options Hash (params):

  • :limit (Integer)

    Maximum number of sessions to return (default: 100, max: 1000)

  • :offset (Integer)

    Number of sessions to skip for pagination (default: 0)

  • :tags (Array<String>)

    Filter sessions by tags

Returns:

  • (Hash)

    Response body

See Also:



15
16
17
# File 'lib/devin_api/endpoints/sessions.rb', line 15

def list_sessions(params = {})
  get('/v1/sessions', params)
end