pub struct CompletionModel<H = Client> {
pub model: String,
pub strict_tools: bool,
pub tool_result_array_content: bool,
pub intent: CopilotIntent,
/* private fields */
}Fields§
§model: String§strict_tools: bool§tool_result_array_content: bool§intent: CopilotIntentImplementations§
Source§impl<H> CompletionModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> CompletionModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
pub fn new( client: Client<CopilotExt, H>, model: impl Into<String>, ) -> CompletionModel<H>
pub fn with_strict_tools(self) -> CompletionModel<H>
pub fn with_tool_result_array_content(self) -> CompletionModel<H>
Sourcepub fn with_intent(self, intent: CopilotIntent) -> CompletionModel<H>
pub fn with_intent(self, intent: CopilotIntent) -> CompletionModel<H>
Set the Copilot openai-intent header for completion and streaming requests.
Sourcepub fn with_panel_intent(self) -> CompletionModel<H>
pub fn with_panel_intent(self) -> CompletionModel<H>
Use the generic chat panel openai-intent header for completion and streaming requests.
Sourcepub fn with_edits_intent(self) -> CompletionModel<H>
pub fn with_edits_intent(self) -> CompletionModel<H>
Use the edit-oriented openai-intent header for completion and streaming requests.
Trait Implementations§
Source§impl<H> Clone for CompletionModel<H>where
H: Clone,
impl<H> Clone for CompletionModel<H>where
H: Clone,
Source§fn clone(&self) -> CompletionModel<H>
fn clone(&self) -> CompletionModel<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 CompletionModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
impl<H> CompletionModel for CompletionModel<H>where
Client<CopilotExt, H>: HttpClientExt + Clone + Debug + 'static,
H: Clone + Default + Debug + WasmCompatSend + WasmCompatSync + 'static,
Source§type Response = CopilotCompletionResponse
type Response = CopilotCompletionResponse
The raw response type returned by the underlying completion model.
Source§type StreamingResponse = CopilotStreamingResponse
type StreamingResponse = CopilotStreamingResponse
The raw response type returned by the underlying completion model when streaming.
Source§type Client = Client<CopilotExt, H>
type Client = Client<CopilotExt, H>
Provider client type used to construct this model.
Source§fn make(
client: &<CompletionModel<H> as CompletionModel>::Client,
model: impl Into<String>,
) -> CompletionModel<H>
fn make( client: &<CompletionModel<H> as CompletionModel>::Client, model: impl Into<String>, ) -> CompletionModel<H>
Construct a model handle from a provider client and model identifier.
Source§async fn completion(
&self,
completion_request: CompletionRequest,
) -> Result<CompletionResponse<<CompletionModel<H> as CompletionModel>::Response>, CompletionError>
async fn completion( &self, completion_request: CompletionRequest, ) -> Result<CompletionResponse<<CompletionModel<H> as CompletionModel>::Response>, CompletionError>
Generates a completion response for the given completion request.
async fn stream( &self, completion_request: CompletionRequest, ) -> Result<StreamingCompletionResponse<<CompletionModel<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 CompletionModel<H>
impl<H = Client> !UnwindSafe for CompletionModel<H>
impl<H> Freeze for CompletionModel<H>where
H: Freeze,
impl<H> Send for CompletionModel<H>where
H: Send,
impl<H> Sync for CompletionModel<H>where
H: Sync,
impl<H> Unpin for CompletionModel<H>where
H: Unpin,
impl<H> UnsafeUnpin for CompletionModel<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