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

Function test_anthropic_build_request_system

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

Source from the content-addressed store, hash-verified

676
677 #[test]
678 fn test_anthropic_build_request_system() {
679 let c = AnthropicClient::new("k".into(), "claude-3".into());
680 let b = c.build_request(&[Message::user("Hi")], Some("Be helpful"), &[]);
681 // System is now an array with cache_control for prompt caching
682 let system = b["system"].as_array().unwrap();
683 assert_eq!(system.len(), 1);
684 assert_eq!(system[0]["text"], "Be helpful");
685 assert_eq!(system[0]["cache_control"]["type"], "ephemeral");
686 }
687
688 #[test]
689 fn test_anthropic_build_request_tools() {

Callers

nothing calls this directly

Calls 1

build_requestMethod · 0.80

Tested by

no test coverage detected