Skip to main content

Codex

Struct Codex 

Source
pub struct Codex { /* private fields */ }
Expand description

Synchronous Codex client mirroring Python’s Codex.

Implementations§

Source§

impl Codex

Source

pub fn new(config: CodexConfig) -> Result<Self>

Source

pub fn with_defaults() -> Result<Self>

Source

pub fn metadata(&self) -> Result<InitializeResponse>

Source

pub fn close(&self) -> Result<()>

Source

pub fn login_api_key(&self, api_key: impl Into<String>) -> Result<()>

Source

pub fn login_chatgpt(&self) -> Result<ChatgptLoginHandle>

Source

pub fn login_chatgpt_device_code(&self) -> Result<DeviceCodeLoginHandle>

Source

pub fn account(&self) -> Result<GetAccountResponse>

Source

pub fn account_with_refresh( &self, refresh_token: bool, ) -> Result<GetAccountResponse>

Source

pub fn logout(&self) -> Result<()>

Source

pub fn thread_start(&self) -> Result<Thread>

Source

pub fn thread_start_with(&self, options: &ThreadStartOptions) -> Result<Thread>

Source

pub fn thread_list(&self) -> Result<ThreadListResponse>

Source

pub fn thread_list_with( &self, options: &ThreadListOptions, ) -> Result<ThreadListResponse>

Source

pub fn thread_resume(&self, thread_id: impl Into<String>) -> Result<Thread>

Source

pub fn thread_resume_with( &self, thread_id: impl Into<String>, options: &ThreadResumeOptions, ) -> Result<Thread>

Source

pub fn thread_fork(&self, thread_id: impl Into<String>) -> Result<Thread>

Source

pub fn thread_fork_with( &self, thread_id: impl Into<String>, options: &ThreadForkOptions, ) -> Result<Thread>

Source

pub fn thread_archive( &self, thread_id: impl Into<String>, ) -> Result<ThreadArchiveResponse>

Source

pub fn thread_unarchive(&self, thread_id: impl Into<String>) -> Result<Thread>

Source

pub fn models(&self) -> Result<ModelListResponse>

Source

pub fn models_including_hidden( &self, include_hidden: bool, ) -> Result<ModelListResponse>

Source

pub fn next_notification(&self) -> Result<Notification>

Trait Implementations§

Source§

impl Debug for Codex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Codex

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Codex

§

impl !UnwindSafe for Codex

§

impl Freeze for Codex

§

impl Send for Codex

§

impl Sync for Codex

§

impl Unpin for Codex

§

impl UnsafeUnpin for Codex

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V