pub struct CopilotWire {
pub wire: OpenAiWire,
pub intent: CopilotIntent,
}Expand description
Completion wire with Copilot’s conversation intent and editor headers.
Delegates payload handling to wire, but overrides its request envelope
even when that field contains another dialect.
Fields§
§wire: OpenAiWireThe route’s wire, pointed at Copilot.
intent: CopilotIntentThe conversation intent this turn declares (openai-intent).
Implementations§
Source§impl CopilotWire
impl CopilotWire
Sourcepub fn intent(&self) -> CopilotIntent
pub fn intent(&self) -> CopilotIntent
The conversation intent this wire declares.
Sourcepub fn with_intent(self, intent: CopilotIntent) -> Self
pub fn with_intent(self, intent: CopilotIntent) -> Self
Declare intent in the openai-intent header.
Sourcepub fn with_panel_intent(self) -> Self
pub fn with_panel_intent(self) -> Self
Declare the generic chat-panel conversation semantics.
Sourcepub fn with_edits_intent(self) -> Self
pub fn with_edits_intent(self) -> Self
Declare the edit-oriented conversation semantics.
Sourcepub fn with_strict_tools(self) -> Self
pub fn with_strict_tools(self) -> Self
Sanitize tool schemas for strict mode on whichever route answers.
The shared Responses::new
constructor already enables this for Copilot, so this is the chat route’s opt-in.
Sourcepub fn with_tool_result_array_content(self) -> Self
pub fn with_tool_result_array_content(self) -> Self
Serialize tool-result content as arrays.
A chat-completions shape: the Responses request has one content encoding, so this is a no-op on that route.
Trait Implementations§
Source§impl Clone for CopilotWire
impl Clone for CopilotWire
Source§impl Debug for CopilotWire
impl Debug for CopilotWire
Source§impl<'de> Deserialize<'de> for CopilotWire
impl<'de> Deserialize<'de> for CopilotWire
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CopilotWire
impl PartialEq for CopilotWire
Source§impl Serialize for CopilotWire
impl Serialize for CopilotWire
impl StructuralPartialEq for CopilotWire
Source§impl Wire for CopilotWire
impl Wire for CopilotWire
Source§type Op = Completion
type Op = Completion
Source§type Payload = Encoded
type Payload = Encoded
Self::encode produces for the transport to send.Source§type Decoder<'id> = OpenAiDecoder<'id>
type Decoder<'id> = OpenAiDecoder<'id>
Source§fn describe(&self) -> Descriptor<'_>
fn describe(&self) -> Descriptor<'_>
Source§fn encode(
&self,
request: CompletionRequest,
mode: Mode,
) -> Result<Encoded, EncodeError>
fn encode( &self, request: CompletionRequest, mode: Mode, ) -> Result<Encoded, EncodeError>
self, request and mode,
and nothing else. A request that cannot be built is an
EncodeError, which always reports as a request failure.Auto Trait Implementations§
impl Freeze for CopilotWire
impl RefUnwindSafe for CopilotWire
impl Send for CopilotWire
impl Sync for CopilotWire
impl Unpin for CopilotWire
impl UnsafeUnpin for CopilotWire
impl UnwindSafe for CopilotWire
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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