pub struct ModelConfig {
pub provider: String,
pub name: String,
pub completion_params: Map<String, Value>,
}Expand description
model: {provider, name, completion_params}.
Fields§
§provider: String§name: String§completion_params: Map<String, Value>Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn request(
&self,
messages: Vec<Message>,
pool: &VariablePool,
) -> Result<ChatRequest, NodeError>
pub fn request( &self, messages: Vec<Message>, pool: &VariablePool, ) -> Result<ChatRequest, NodeError>
Build a request for this model, applying completion parameters. Parameter
values that are templates ("{{#start.temp#}}") are resolved per run;
the configuration itself is never modified.
A parameter whose value has the wrong type (e.g. temperature: "hot"),
or a template that resolves to nothing, is an input error naming the
parameter instead of being dropped silently.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§impl Debug for ModelConfig
impl Debug for ModelConfig
Source§impl<'de> Deserialize<'de> for ModelConfig
impl<'de> Deserialize<'de> for ModelConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for ModelConfig
impl Freeze for ModelConfig
impl Move for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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