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

Function test_anthropic_build_request_with_system

core/src/llm/tests.rs:881–891  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

879
880 #[test]
881 fn test_anthropic_build_request_with_system() {
882 let client =
883 AnthropicClient::new("key".to_string(), "claude-sonnet-4-20250514".to_string());
884 let msgs = vec![Message::user("Hello")];
885 let req = client.build_request(&msgs, Some("You are helpful"), &[]);
886
887 // System is now an array with cache_control for prompt caching
888 let system = req["system"].as_array().unwrap();
889 assert_eq!(system[0]["text"], "You are helpful");
890 assert_eq!(system[0]["cache_control"]["type"], "ephemeral");
891 }
892
893 #[test]
894 fn test_anthropic_build_request_with_tools() {

Callers

nothing calls this directly

Calls 1

build_requestMethod · 0.80

Tested by

no test coverage detected