pub struct ExecutorAsyncOpenai { /* private fields */ }Expand description
Executes non-streaming Chat Completions and returns the first choice’s text.
Task models override the configured default. Missing models, malformed chat
data, and request/API failures return Err; missing choices or text produce
an unsuccessful Response. Reported usage is total tokens, or zero if absent.
Sends the optional system instruction, prior user/assistant turns, and the current prompt as a user message, in that order.
§Current limitations
- System entries in input history are discarded; use
TaskChat::systemfor a persistent system instruction. - Returned history currently duplicates the latest user prompt: it is kept from the request messages and appended again before the assistant reply.
- Schemas request strict JSON output named
response; returned text is not locally parsed or validated against the schema. max_tokensis cast fromu64tou32without range checking. Payload metadata is preserved in the task but is not sent to the model.
Implementations§
Source§impl ExecutorAsyncOpenai
impl ExecutorAsyncOpenai
Sourcepub fn from_env_or_default() -> Self
pub fn from_env_or_default() -> Self
Creates a client without contacting the endpoint.
Reads OPENAI_API_URL (default http://127.0.0.1:8000/v1) and snapshots
OPENAI_API_DEFAULT_MODEL. Authentication uses async-openai’s default
configuration. Endpoint/model validity is checked only when executing.
Trait Implementations§
Source§impl Clone for ExecutorAsyncOpenai
impl Clone for ExecutorAsyncOpenai
Source§fn clone(&self) -> ExecutorAsyncOpenai
fn clone(&self) -> ExecutorAsyncOpenai
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecutorAsyncOpenai
impl Debug for ExecutorAsyncOpenai
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutorAsyncOpenai
impl !UnwindSafe for ExecutorAsyncOpenai
impl Freeze for ExecutorAsyncOpenai
impl Send for ExecutorAsyncOpenai
impl Sync for ExecutorAsyncOpenai
impl Unpin for ExecutorAsyncOpenai
impl UnsafeUnpin for ExecutorAsyncOpenai
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