pub struct Codex { /* private fields */ }Expand description
Cloneable, validated Codex CLI runtime.
Implementations§
Source§impl Codex
impl Codex
Sourcepub async fn open(
config: CodexConfig,
catalog_cache: CatalogCache,
) -> Result<Self>
pub async fn open( config: CodexConfig, catalog_cache: CatalogCache, ) -> Result<Self>
Loads the shared model catalog, validates ChatGPT login, and verifies that ordinary generation exposes exactly the caller’s prompt item.
Sourcepub async fn generate(
&self,
request: GenerationRequest,
) -> Result<GenerationResponse>
pub async fn generate( &self, request: GenerationRequest, ) -> Result<GenerationResponse>
Performs an ordinary generation, optionally resuming a Codex thread.
Sourcepub async fn web_search(
&self,
request: WebSearchRequest,
) -> Result<WebSearchResponse>
pub async fn web_search( &self, request: WebSearchRequest, ) -> Result<WebSearchResponse>
Performs a fresh, ephemeral Codex turn with only native web search enabled and returns all deduplicated HTTP(S) links from the answer.
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