@@ -5,13 +5,17 @@ import FunctionCalling
55import AIProxy
66
77extension ToolContainer {
8+ public typealias AIProxyOpenAITool = OpenAIChatCompletionRequestBody . Tool
9+ public typealias AIProxyAnthropicTool = AnthropicTool
10+ public typealias AIProxyTogetherAITool = TogetherAITool
11+
812 // swiftlint:disable:next line_length
913 // https://github.com/lzell/AIProxySwift?tab=readme-ov-file#how-to-use-openai-structured-outputs-json-schemas-in-a-tool-call
10- func toOpenAITools( strict: Bool = false ) -> [ OpenAIChatCompletionTool ] {
14+ func toOpenAITools( strict: Bool = false ) -> [ AIProxyOpenAITool ] {
1115 guard let allTools else { return [ ] }
1216
1317 return allTools. map { tool in
14- OpenAIChatCompletionTool . function (
18+ AIProxyOpenAITool . function (
1519 name: tool. name,
1620 description: tool. description,
1721 parameters: tool. inputSchema. toJSONSchema ( ) ,
@@ -21,11 +25,11 @@ extension ToolContainer {
2125 }
2226
2327 // https://github.com/lzell/AIProxySwift?tab=readme-ov-file#how-to-use-streaming-tool-calls-with-anthropic
24- func toAnthropicTools( ) -> [ AnthropicTool ] {
28+ func toAnthropicTools( ) -> [ AIProxyAnthropicTool ] {
2529 guard let allTools else { return [ ] }
2630
2731 return allTools. map { tool in
28- AnthropicTool (
32+ AIProxyAnthropicTool (
2933 description: tool. description,
3034 inputSchema: tool. inputSchema. toJSONSchema ( ) ,
3135 name: tool. name
@@ -35,11 +39,11 @@ extension ToolContainer {
3539
3640 // swiftlint:disable:next line_length
3741 // https://github.com/lzell/AIProxySwift?tab=readme-ov-file#how-to-make-a-tool-call-request-with-llama-and-togetherai
38- func toTogetherAITools( ) -> [ TogetherAITool ] {
42+ func toTogetherAITools( ) -> [ AIProxyTogetherAITool ] {
3943 guard let allTools else { return [ ] }
4044
4145 return allTools. map { tool in
42- TogetherAITool (
46+ AIProxyTogetherAITool (
4347 function: . init(
4448 description: tool. description,
4549 name: tool. name,
0 commit comments