Class: CodexSDK::Client
- Inherits:
-
Object
- Object
- CodexSDK::Client
- Defined in:
- lib/codex_sdk/client.rb
Instance Method Summary collapse
-
#initialize(codex_path: nil, base_url: nil, api_key: nil, config: {}, env: nil) ⇒ Client
constructor
A new instance of Client.
-
#resume_thread(thread_id, **kwargs) ⇒ Object
Resume an existing thread by ID.
-
#start_thread(**kwargs) ⇒ Object
Start a new thread with the given options.
Constructor Details
#initialize(codex_path: nil, base_url: nil, api_key: nil, config: {}, env: nil) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 |
# File 'lib/codex_sdk/client.rb', line 5 def initialize(codex_path: nil, base_url: nil, api_key: nil, config: {}, env: nil) @options = Options.new( codex_path: codex_path, base_url: base_url, api_key: api_key, config: config, env: env ) end |
Instance Method Details
#resume_thread(thread_id, **kwargs) ⇒ Object
Resume an existing thread by ID.
22 23 24 25 |
# File 'lib/codex_sdk/client.rb', line 22 def resume_thread(thread_id, **kwargs) = ThreadOptions.new(**kwargs) AgentThread.new(@options, thread_options: , resume_id: thread_id) end |
#start_thread(**kwargs) ⇒ Object
Start a new thread with the given options.
16 17 18 19 |
# File 'lib/codex_sdk/client.rb', line 16 def start_thread(**kwargs) = ThreadOptions.new(**kwargs) AgentThread.new(@options, thread_options: ) end |