()
| 789 | |
| 790 | #[test] |
| 791 | fn test_build_request_with_tools() { |
| 792 | let client = make_client(); |
| 793 | let messages = vec![Message::user("Use a tool")]; |
| 794 | let tools = vec![ToolDefinition { |
| 795 | name: "read_file".to_string(), |
| 796 | description: "Read a file".to_string(), |
| 797 | parameters: serde_json::json!({"type": "object", "properties": {}}), |
| 798 | }]; |
| 799 | let req = client.build_request(&messages, None, &tools); |
| 800 | |
| 801 | assert!(req["tools"].is_array()); |
| 802 | assert_eq!(req["tools"][0]["name"], "read_file"); |
| 803 | // Last tool should have cache_control |
| 804 | assert!(req["tools"][0]["cache_control"].is_object()); |
| 805 | } |
| 806 | |
| 807 | #[test] |
| 808 | fn test_build_request_thinking_budget_sets_max_tokens() { |
nothing calls this directly
no test coverage detected