pub struct OpenAIProtocol { /* private fields */ }Expand description
OpenAI协议实现
Implementations§
Trait Implementations§
Source§impl Clone for OpenAIProtocol
impl Clone for OpenAIProtocol
Source§fn clone(&self) -> OpenAIProtocol
fn clone(&self) -> OpenAIProtocol
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenAIProtocol
impl Debug for OpenAIProtocol
Source§impl Protocol for OpenAIProtocol
impl Protocol for OpenAIProtocol
Source§type Request = OpenAIRequest
type Request = OpenAIRequest
协议特定的请求类型
Source§type Response = OpenAIResponse
type Response = OpenAIResponse
协议特定的响应类型
Source§fn chat_endpoint(&self, base_url: &str) -> String
fn chat_endpoint(&self, base_url: &str) -> String
获取聊天完成的端点URL
Source§fn build_request(
&self,
request: &ChatRequest,
) -> Result<Self::Request, LlmConnectorError>
fn build_request( &self, request: &ChatRequest, ) -> Result<Self::Request, LlmConnectorError>
构建协议特定的请求
Source§fn parse_response(
&self,
response: &str,
) -> Result<ChatResponse, LlmConnectorError>
fn parse_response( &self, response: &str, ) -> Result<ChatResponse, LlmConnectorError>
解析协议特定的响应
Source§fn parse_models(&self, response: &str) -> Result<Vec<String>, LlmConnectorError>
fn parse_models(&self, response: &str) -> Result<Vec<String>, LlmConnectorError>
解析模型列表响应
Auto Trait Implementations§
impl Freeze for OpenAIProtocol
impl RefUnwindSafe for OpenAIProtocol
impl Send for OpenAIProtocol
impl Sync for OpenAIProtocol
impl Unpin for OpenAIProtocol
impl UnwindSafe for OpenAIProtocol
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