Skip to content

Commit 66cf0fa

Browse files
committed
accept OpenAI tool type name change
1 parent 8988ba5 commit 66cf0fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/FunctionCalling-AIProxySwift/FunctionCalling_AIProxySwift.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import FunctionCalling
55
import AIProxy
66

77
extension ToolContainer {
8+
public typealias AIProxyOpenAITool = OpenAIChatCompletionRequestBody.Tool
89
// swiftlint:disable:next line_length
910
// 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] {
11+
func toOpenAITools(strict: Bool = false) -> [AIProxyOpenAITool] {
1112
guard let allTools else { return [] }
1213

1314
return allTools.map { tool in
14-
OpenAIChatCompletionTool.function(
15+
AIProxyOpenAITool.function(
1516
name: tool.name,
1617
description: tool.description,
1718
parameters: tool.inputSchema.toJSONSchema(),

0 commit comments

Comments
 (0)