Download crates/forge_config/src/model.rs from SaylorTwift/forgecode: direct link, hf CLI and curl.
- Browser
- Download file 865 Bytes
-
https://huggingface.co/SaylorTwift/forgecode/resolve/main/crates/forge_config/src/model.rs
- Command line
-
hf download hf://SaylorTwift/forgecode/crates/forge_config/src/model.rs
-
curl -L -o model.rs https://huggingface.co/SaylorTwift/forgecode/resolve/main/crates/forge_config/src/model.rs
865 Bytes
| use derive_setters::Setters; | |
| use schemars::JsonSchema; | |
| use serde::{Deserialize, Serialize}; | |
| /// A type alias for a provider identifier string. | |
| pub type ProviderId = String; | |
| /// A type alias for a model identifier string. | |
| pub type ModelId = String; | |
| /// Pairs a provider and model together for a specific operation. | |
| pub struct ModelConfig { | |
| /// The provider to use for this operation. | |
| pub provider_id: String, | |
| /// The model to use for this operation. | |
| pub model_id: String, | |
| } | |
| impl ModelConfig { | |
| /// Creates a new ModelConfig with the given provider and model IDs. | |
| pub fn new(provider_id: impl Into<String>, model_id: impl Into<String>) -> Self { | |
| Self { provider_id: provider_id.into(), model_id: model_id.into() } | |
| } | |
| } | |