pub struct AnthropicProtocol { /* private fields */ }Expand description
Anthropic Claude协议实现
Implementations§
Trait Implementations§
Source§impl Clone for AnthropicProtocol
impl Clone for AnthropicProtocol
Source§fn clone(&self) -> AnthropicProtocol
fn clone(&self) -> AnthropicProtocol
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 AnthropicProtocol
impl Debug for AnthropicProtocol
Source§impl Protocol for AnthropicProtocol
impl Protocol for AnthropicProtocol
Source§type Request = AnthropicRequest
type Request = AnthropicRequest
协议特定的请求类型
Source§type Response = AnthropicResponse
type Response = AnthropicResponse
协议特定的响应类型
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 AnthropicProtocol
impl RefUnwindSafe for AnthropicProtocol
impl Send for AnthropicProtocol
impl Sync for AnthropicProtocol
impl Unpin for AnthropicProtocol
impl UnwindSafe for AnthropicProtocol
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