pub struct DeepSeekConfig {
pub api_key: String,
pub model: String,
pub base_url: Option<String>,
pub thinking_enabled: bool,
pub max_tokens: Option<u32>,
}Available on crate feature
models only.Expand description
Configuration for DeepSeek API.
Fields§
§api_key: StringDeepSeek API key.
model: StringModel name (e.g., “deepseek-chat”, “deepseek-reasoner”).
base_url: Option<String>Optional custom base URL.
thinking_enabled: boolEnable thinking mode for reasoning models. When enabled, the model outputs chain-of-thought reasoning before the final answer.
max_tokens: Option<u32>Maximum tokens for output (default: 4096, max for reasoner: 64K).
Implementations§
Source§impl DeepSeekConfig
impl DeepSeekConfig
Sourcepub fn new(
api_key: impl Into<String>,
model: impl Into<String>,
) -> DeepSeekConfig
Available on crate feature deepseek only.
pub fn new( api_key: impl Into<String>, model: impl Into<String>, ) -> DeepSeekConfig
deepseek only.Create a new DeepSeek config with the given API key and model.
Sourcepub fn chat(api_key: impl Into<String>) -> DeepSeekConfig
Available on crate feature deepseek only.
pub fn chat(api_key: impl Into<String>) -> DeepSeekConfig
deepseek only.Create a config for deepseek-chat model.
Sourcepub fn reasoner(api_key: impl Into<String>) -> DeepSeekConfig
Available on crate feature deepseek only.
pub fn reasoner(api_key: impl Into<String>) -> DeepSeekConfig
deepseek only.Create a config for deepseek-reasoner model with thinking enabled.
Sourcepub fn with_thinking(self, enabled: bool) -> DeepSeekConfig
Available on crate feature deepseek only.
pub fn with_thinking(self, enabled: bool) -> DeepSeekConfig
deepseek only.Enable thinking mode (chain-of-thought reasoning).
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> DeepSeekConfig
Available on crate feature deepseek only.
pub fn with_max_tokens(self, max_tokens: u32) -> DeepSeekConfig
deepseek only.Set max tokens for output.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> DeepSeekConfig
Available on crate feature deepseek only.
pub fn with_base_url(self, base_url: impl Into<String>) -> DeepSeekConfig
deepseek only.Set custom base URL.
Sourcepub fn effective_base_url(&self) -> &str
Available on crate feature deepseek only.
pub fn effective_base_url(&self) -> &str
deepseek only.Get the effective base URL.
Trait Implementations§
Source§impl Clone for DeepSeekConfig
impl Clone for DeepSeekConfig
Source§fn clone(&self) -> DeepSeekConfig
fn clone(&self) -> DeepSeekConfig
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 DeepSeekConfig
impl Debug for DeepSeekConfig
Source§impl Default for DeepSeekConfig
impl Default for DeepSeekConfig
Source§fn default() -> DeepSeekConfig
fn default() -> DeepSeekConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DeepSeekConfig
impl<'de> Deserialize<'de> for DeepSeekConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeepSeekConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeepSeekConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DeepSeekConfig
impl Serialize for DeepSeekConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DeepSeekConfig
impl RefUnwindSafe for DeepSeekConfig
impl Send for DeepSeekConfig
impl Sync for DeepSeekConfig
impl Unpin for DeepSeekConfig
impl UnwindSafe for DeepSeekConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request