Skip to content

Commit afe4a28

Browse files
authored
Merge pull request #7 from FunctionCalling/renovate/lzell-aiproxyswift-0.x
Update dependency lzell/AIProxySwift to from: "0.44.0"
2 parents 0159d53 + f369656 commit afe4a28

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let package = Package(
2020
],
2121
dependencies: [
2222
.package(url: "https://github.com/fumito-ito/FunctionCalling", from: "0.5.0"),
23-
.package(url: "https://github.com/lzell/AIProxySwift.git", from: "0.43.0")
23+
.package(url: "https://github.com/lzell/AIProxySwift.git", from: "0.44.0")
2424
],
2525
targets: [
2626
// Targets are the basic building blocks of a package, defining a module or a test suite.

Sources/FunctionCalling-AIProxySwift/FunctionCalling_AIProxySwift.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import FunctionCalling
55
import AIProxy
66

77
extension 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

Comments
 (0)