()
| 892 | |
| 893 | #[test] |
| 894 | fn test_anthropic_build_request_with_tools() { |
| 895 | let client = |
| 896 | AnthropicClient::new("key".to_string(), "claude-sonnet-4-20250514".to_string()); |
| 897 | let msgs = vec![Message::user("Hello")]; |
| 898 | let tools = vec![ToolDefinition { |
| 899 | name: "bash".to_string(), |
| 900 | description: "Run a command".to_string(), |
| 901 | parameters: serde_json::json!({"type": "object", "properties": {"command": {"type": "string"}}}), |
| 902 | }]; |
| 903 | let req = client.build_request(&msgs, None, &tools); |
| 904 | |
| 905 | assert!(req["tools"].is_array()); |
| 906 | assert_eq!(req["tools"][0]["name"], "bash"); |
| 907 | assert_eq!(req["tools"][0]["description"], "Run a command"); |
| 908 | assert!(req["tools"][0]["input_schema"].is_object()); |
| 909 | } |
| 910 | |
| 911 | #[test] |
| 912 | fn test_anthropic_build_request_max_tokens() { |
nothing calls this directly
no test coverage detected