| 736 | |
| 737 | #[test] |
| 738 | fn test_convert_tool() { |
| 739 | let tool = LlmTool { |
| 740 | name: "get_weather".to_string(), |
| 741 | description: "Get the current weather".to_string(), |
| 742 | parameters: json!({ |
| 743 | "type": "object", |
| 744 | "properties": { |
| 745 | "location": { |
| 746 | "type": "string", |
| 747 | "description": "The city name" |
| 748 | } |
| 749 | }, |
| 750 | "required": ["location"] |
| 751 | }), |
| 752 | }; |
| 753 | |
| 754 | let azure_tool = AzureLlmProvider::convert_tool(&tool); |
| 755 | assert_eq!(azure_tool.r#type, "function"); |
| 756 | assert_eq!(azure_tool.function.name, "get_weather"); |
| 757 | assert_eq!(azure_tool.function.description, "Get the current weather"); |
| 758 | assert_eq!(azure_tool.function.parameters["type"], "object"); |
| 759 | } |
| 760 | } |