pub struct Codex { /* private fields */ }Expand description
Entry point for interacting with the Codex agent.
Implementations§
Source§impl Codex
impl Codex
Sourcepub fn new(options: Option<CodexOptions>) -> Result<Self>
pub fn new(options: Option<CodexOptions>) -> Result<Self>
Creates a new Codex client.
When options is None, default options are used and the SDK attempts
to discover the codex executable automatically.
§Example
use codex::Codex;
let _codex = Codex::new(None)?;Sourcepub fn start_thread(&self, options: Option<ThreadOptions>) -> Thread
pub fn start_thread(&self, options: Option<ThreadOptions>) -> Thread
Starts a new thread.
§Example
use codex::Codex;
let codex = Codex::new(None)?;
let _thread = codex.start_thread(None);Sourcepub fn resume_thread(
&self,
id: impl Into<String>,
options: Option<ThreadOptions>,
) -> Thread
pub fn resume_thread( &self, id: impl Into<String>, options: Option<ThreadOptions>, ) -> Thread
Resumes an existing thread by id.
§Example
use codex::Codex;
let codex = Codex::new(None)?;
let _thread = codex.resume_thread("thread_123", None);Trait Implementations§
Auto Trait Implementations§
impl Freeze for Codex
impl RefUnwindSafe for Codex
impl Send for Codex
impl Sync for Codex
impl Unpin for Codex
impl UnsafeUnpin for Codex
impl UnwindSafe for Codex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more