pub struct AliyunProtocol { /* private fields */ }Expand description
阿里云DashScope私有协议实现
这是阿里云专用的API格式,与OpenAI和Anthropic都不同。 由于这是私有协议,定义在provider内部而不是公开的protocols模块中。
Implementations§
Trait Implementations§
Source§impl Clone for AliyunProtocol
impl Clone for AliyunProtocol
Source§fn clone(&self) -> AliyunProtocol
fn clone(&self) -> AliyunProtocol
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 AliyunProtocol
impl Debug for AliyunProtocol
Source§impl Protocol for AliyunProtocol
impl Protocol for AliyunProtocol
Source§type Request = AliyunRequest
type Request = AliyunRequest
协议特定的请求类型
Source§type Response = AliyunResponse
type Response = AliyunResponse
协议特定的响应类型
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 AliyunProtocol
impl RefUnwindSafe for AliyunProtocol
impl Send for AliyunProtocol
impl Sync for AliyunProtocol
impl Unpin for AliyunProtocol
impl UnwindSafe for AliyunProtocol
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