pub struct ResponsesCompletionModel<H = Client> {
pub model: String,
pub tools: Vec<ResponsesToolDefinition>,
pub strict_tools: bool,
/* private fields */
}Fields§
§model: String§tools: Vec<ResponsesToolDefinition>§strict_tools: boolImplementations§
Source§impl<H> ResponsesCompletionModel<H>where
Client<H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> ResponsesCompletionModel<H>where
Client<H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
pub fn new(client: Client<H>, model: impl Into<String>) -> Self
Sourcepub fn with_strict_tools(self) -> Self
pub fn with_strict_tools(self) -> Self
Enable strict mode for function tool schemas.
pub fn with_tool(self, tool: impl Into<ResponsesToolDefinition>) -> Self
pub fn with_tools<I, Tool>(self, tools: I) -> Self
Source§impl<H> ResponsesCompletionModel<H>where
Client<H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> ResponsesCompletionModel<H>where
Client<H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
pub async fn stream( &self, completion_request: CompletionRequest, ) -> Result<StreamingCompletionResponse<StreamingCompletionResponse>, CompletionError>
Trait Implementations§
Source§impl<H: Clone> Clone for ResponsesCompletionModel<H>
impl<H: Clone> Clone for ResponsesCompletionModel<H>
Source§fn clone(&self) -> ResponsesCompletionModel<H>
fn clone(&self) -> ResponsesCompletionModel<H>
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<H> CompletionModel for ResponsesCompletionModel<H>where
Client<H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> CompletionModel for ResponsesCompletionModel<H>where
Client<H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
Source§type Response = CompletionResponse
type Response = CompletionResponse
The raw response type returned by the underlying completion model.
Source§type StreamingResponse = StreamingCompletionResponse
type StreamingResponse = StreamingCompletionResponse
The raw response type returned by the underlying completion model when streaming.
Source§type Client = Client<ChatGPTExt, H>
type Client = Client<ChatGPTExt, H>
Provider client type used to construct this model.
Source§fn make(client: &Self::Client, model: impl Into<String>) -> Self
fn make(client: &Self::Client, model: impl Into<String>) -> Self
Construct a model handle from a provider client and model identifier.
Source§async fn completion(
&self,
completion_request: CompletionRequest,
) -> Result<CompletionResponse<Self::Response>, CompletionError>
async fn completion( &self, completion_request: CompletionRequest, ) -> Result<CompletionResponse<Self::Response>, CompletionError>
Generates a completion response for the given completion request.
async fn stream( &self, completion_request: CompletionRequest, ) -> Result<StreamingCompletionResponse<Self::StreamingResponse>, CompletionError>
Source§fn completion_request(
&self,
prompt: impl Into<Message>,
) -> CompletionRequestBuilder<Self>
fn completion_request( &self, prompt: impl Into<Message>, ) -> CompletionRequestBuilder<Self>
Generates a completion request builder for the given
prompt.Source§fn composes_native_output_with_tools(&self) -> bool
fn composes_native_output_with_tools(&self) -> bool
Whether this provider’s native structured output (
output_schema ->
format/response_format) composes with tool calls in the same
multi-turn request without suppressing them. Read moreAuto Trait Implementations§
impl<H = Client> !RefUnwindSafe for ResponsesCompletionModel<H>
impl<H = Client> !UnwindSafe for ResponsesCompletionModel<H>
impl<H> Freeze for ResponsesCompletionModel<H>where
H: Freeze,
impl<H> Send for ResponsesCompletionModel<H>where
H: Send,
impl<H> Sync for ResponsesCompletionModel<H>where
H: Sync,
impl<H> Unpin for ResponsesCompletionModel<H>where
H: Unpin,
impl<H> UnsafeUnpin for ResponsesCompletionModel<H>where
H: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more