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<ChatGPTExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> ResponsesCompletionModel<H>where
Client<ChatGPTExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
pub fn new( client: Client<ChatGPTExt, H>, model: impl Into<String>, ) -> ResponsesCompletionModel<H>
Sourcepub fn with_strict_tools(self) -> ResponsesCompletionModel<H>
pub fn with_strict_tools(self) -> ResponsesCompletionModel<H>
Enable strict mode for function tool schemas.
pub fn with_tool( self, tool: impl Into<ResponsesToolDefinition>, ) -> ResponsesCompletionModel<H>
pub fn with_tools<I, Tool>(self, tools: I) -> ResponsesCompletionModel<H>
Source§impl<H> ResponsesCompletionModel<H>where
Client<ChatGPTExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> ResponsesCompletionModel<H>where
Client<ChatGPTExt, 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 for ResponsesCompletionModel<H>where
H: Clone,
impl<H> Clone for ResponsesCompletionModel<H>where
H: Clone,
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<ChatGPTExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> CompletionModel for ResponsesCompletionModel<H>where
Client<ChatGPTExt, 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: &<ResponsesCompletionModel<H> as CompletionModel>::Client,
model: impl Into<String>,
) -> ResponsesCompletionModel<H>
fn make( client: &<ResponsesCompletionModel<H> as CompletionModel>::Client, model: impl Into<String>, ) -> ResponsesCompletionModel<H>
Construct a model handle from a provider client and model identifier.
Source§async fn completion(
&self,
completion_request: CompletionRequest,
) -> Result<CompletionResponse<<ResponsesCompletionModel<H> as CompletionModel>::Response>, CompletionError>
async fn completion( &self, completion_request: CompletionRequest, ) -> Result<CompletionResponse<<ResponsesCompletionModel<H> as CompletionModel>::Response>, CompletionError>
Generates a completion response for the given completion request.
async fn stream( &self, completion_request: CompletionRequest, ) -> Result<StreamingCompletionResponse<<ResponsesCompletionModel<H> as CompletionModel>::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<M> AgentModelExt for Mwhere
M: CompletionModel,
impl<M> AgentModelExt for Mwhere
M: CompletionModel,
Source§fn into_agent_builder(self) -> AgentBuilder<Self>
fn into_agent_builder(self) -> AgentBuilder<Self>
Convert this model into a classic agent builder.
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