pub struct CompletionResponse {
pub openai: CompletionResponse,
pub venice_parameters: Option<VeniceParametersEcho>,
pub cost: Option<Cost>,
}Expand description
Venice’s chat-completions payload: OpenAI’s response plus the
venice_parameters echo and the request’s cost.
Normalization and telemetry delegate to the OpenAI payload — the wire
shape of choices/usage is OpenAI’s — so the Venice-only blocks are
preserved for raw_completion callers without forking the conversion.
Fields§
§openai: CompletionResponseThe OpenAI-compatible portion of the payload.
venice_parameters: Option<VeniceParametersEcho>Venice’s resolved parameter block, including web-search citations.
cost: Option<Cost>What Venice charged for this request.
Implementations§
Source§impl CompletionResponse
impl CompletionResponse
Sourcepub fn web_search_citations(&self) -> &[WebSearchCitation]
pub fn web_search_citations(&self) -> &[WebSearchCitation]
The web-search sources Venice consulted, empty when search did not run.
Trait Implementations§
Source§impl Debug for CompletionResponse
impl Debug for CompletionResponse
Source§impl<'de> Deserialize<'de> for CompletionResponse
impl<'de> Deserialize<'de> for CompletionResponse
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl NormalizeCompletionResponse for CompletionResponse
impl NormalizeCompletionResponse for CompletionResponse
Source§fn normalize(
self,
provider: &str,
) -> Result<CompletionResponse, CompletionError>
fn normalize( self, provider: &str, ) -> Result<CompletionResponse, CompletionError>
Normalize this payload, attributing it to
provider.Source§impl ProviderResponseExt for CompletionResponse
impl ProviderResponseExt for CompletionResponse
Source§type Usage = <CompletionResponse as ProviderResponseExt>::Usage
type Usage = <CompletionResponse as ProviderResponseExt>::Usage
Provider-native usage type.
Source§fn get_response_id(&self) -> Option<String>
fn get_response_id(&self) -> Option<String>
Returns the provider response ID, if supplied.
Source§fn get_response_model_name(&self) -> Option<String>
fn get_response_model_name(&self) -> Option<String>
Returns the provider response model name, if supplied.
Source§fn get_text_response(&self) -> Option<String>
fn get_text_response(&self) -> Option<String>
Returns the primary text response, when available.
Auto Trait Implementations§
impl Freeze for CompletionResponse
impl RefUnwindSafe for CompletionResponse
impl Send for CompletionResponse
impl Sync for CompletionResponse
impl Unpin for CompletionResponse
impl UnsafeUnpin for CompletionResponse
impl UnwindSafe for CompletionResponse
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
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> 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 moreSource§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.