pub struct MuseConfig {
pub api_key: String,
pub model: String,
pub base_url: Option<String>,
pub max_tokens: Option<u32>,
pub api: MuseApi,
}Expand description
Configuration for the Meta Model API.
The key is read from META_API_KEY (Meta also documents MODEL_API_KEY); see the
module documentation for an example.
The API key is redacted from Debug output and omitted when serializing.
Fields§
§api_key: StringMeta Model API key. Never serialized; deserializing a config without it yields an empty key.
model: StringModel name.
base_url: Option<String>Optional custom base URL.
max_tokens: Option<u32>Maximum tokens for output.
api: MuseApiThe endpoint the client calls.
Implementations§
Source§impl MuseConfig
impl MuseConfig
Sourcepub fn new(api_key: impl Into<String>, model: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>, model: impl Into<String>) -> Self
Create a new Muse config with the given API key and model.
Sourcepub fn spark_1_3(api_key: impl Into<String>) -> Self
pub fn spark_1_3(api_key: impl Into<String>) -> Self
Create a config for muse-spark-1.3, the recommended default.
Sourcepub fn spark_1_2(api_key: impl Into<String>) -> Self
pub fn spark_1_2(api_key: impl Into<String>) -> Self
Create a config for muse-spark-1.2, the previous version.
§Example
use adk_model::muse::MuseConfig;
let config = MuseConfig::spark_1_2("LLM-key");
assert_eq!(config.model, "muse-spark-1.2");Sourcepub fn spark_1_1(api_key: impl Into<String>) -> Self
pub fn spark_1_1(api_key: impl Into<String>) -> Self
Create a config for muse-spark-1.1, the original version.
Sourcepub fn wonder(api_key: impl Into<String>) -> Self
pub fn wonder(api_key: impl Into<String>) -> Self
Create a config for muse-wonder-1.0, the flagship (preview) model.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Set max tokens for output.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Set custom base URL.
Sourcepub fn effective_base_url(&self) -> &str
pub fn effective_base_url(&self) -> &str
Get the effective base URL.
Trait Implementations§
Source§impl Clone for MuseConfig
impl Clone for MuseConfig
Source§impl Debug for MuseConfig
impl Debug for MuseConfig
Source§impl Default for MuseConfig
impl Default for MuseConfig
Source§impl<'de> Deserialize<'de> for MuseConfig
impl<'de> Deserialize<'de> for MuseConfig
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>,
Auto Trait Implementations§
impl Forget for MuseConfig
impl Freeze for MuseConfig
impl Move for MuseConfig
impl RefUnwindSafe for MuseConfig
impl Send for MuseConfigwhere
RawVecInner: Send,
impl Sync for MuseConfigwhere
RawVecInner: Sync,
impl Unpin for MuseConfig
impl UnsafeUnpin for MuseConfig
impl UnwindSafe for MuseConfigwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request