| 17 | |
| 18 | impl CohereProvider { |
| 19 | pub fn new(api_key: impl Into<String>) -> Self { |
| 20 | Self { |
| 21 | client: Client::new(), |
| 22 | api_key: api_key.into(), |
| 23 | models: vec![ |
| 24 | ModelInfo { |
| 25 | id: "command-r-plus-08-2024".to_string(), |
| 26 | name: "Command R+".to_string(), |
| 27 | provider: "cohere".to_string(), |
| 28 | context_window: 128000, |
| 29 | max_output_tokens: 4096, |
| 30 | supports_vision: false, |
| 31 | supports_tools: true, |
| 32 | cost_per_million_input: 2.5, |
| 33 | cost_per_million_output: 10.0, |
| 34 | }, |
| 35 | ModelInfo { |
| 36 | id: "command-r-08-2024".to_string(), |
| 37 | name: "Command R".to_string(), |
| 38 | provider: "cohere".to_string(), |
| 39 | context_window: 128000, |
| 40 | max_output_tokens: 4096, |
| 41 | supports_vision: false, |
| 42 | supports_tools: true, |
| 43 | cost_per_million_input: 0.15, |
| 44 | cost_per_million_output: 0.6, |
| 45 | }, |
| 46 | ModelInfo { |
| 47 | id: "command".to_string(), |
| 48 | name: "Command".to_string(), |
| 49 | provider: "cohere".to_string(), |
| 50 | context_window: 4096, |
| 51 | max_output_tokens: 4096, |
| 52 | supports_vision: false, |
| 53 | supports_tools: false, |
| 54 | cost_per_million_input: 1.0, |
| 55 | cost_per_million_output: 2.0, |
| 56 | }, |
| 57 | ModelInfo { |
| 58 | id: "command-light".to_string(), |
| 59 | name: "Command Light".to_string(), |
| 60 | provider: "cohere".to_string(), |
| 61 | context_window: 4096, |
| 62 | max_output_tokens: 4096, |
| 63 | supports_vision: false, |
| 64 | supports_tools: false, |
| 65 | cost_per_million_input: 0.3, |
| 66 | cost_per_million_output: 0.6, |
| 67 | }, |
| 68 | ], |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | #[async_trait] |