MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_llm_config_specific_provider_model

Function test_llm_config_specific_provider_model

core/src/config/tests.rs:1008–1032  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1006
1007#[test]
1008fn test_llm_config_specific_provider_model() {
1009 let model: ModelConfig = serde_json::from_value(serde_json::json!({
1010 "id": "claude-3",
1011 "name": "Claude 3"
1012 }))
1013 .unwrap();
1014
1015 let config = CodeConfig {
1016 providers: vec![ProviderConfig {
1017 name: "anthropic".to_string(),
1018 api_key: Some("sk-test".to_string()),
1019 base_url: None,
1020 headers: HashMap::new(),
1021 session_id_header: None,
1022 models: vec![model],
1023 }],
1024 ..Default::default()
1025 };
1026
1027 let llm = config.llm_config("anthropic", "claude-3");
1028 assert!(llm.is_some());
1029 let llm = llm.unwrap();
1030 assert_eq!(llm.provider, "anthropic");
1031 assert_eq!(llm.model, "claude-3");
1032}
1033
1034#[test]
1035fn test_llm_config_missing_provider() {

Callers

nothing calls this directly

Calls 1

llm_configMethod · 0.80

Tested by

no test coverage detected