Skip to content

Commit f369656

Browse files
committed
also use typealias for other types
1 parent 66cf0fa commit f369656

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sources/FunctionCalling-AIProxySwift/FunctionCalling_AIProxySwift.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import AIProxy
66

77
extension ToolContainer {
88
public typealias AIProxyOpenAITool = OpenAIChatCompletionRequestBody.Tool
9+
public typealias AIProxyAnthropicTool = AnthropicTool
10+
public typealias AIProxyTogetherAITool = TogetherAITool
11+
912
// swiftlint:disable:next line_length
1013
// https://github.com/lzell/AIProxySwift?tab=readme-ov-file#how-to-use-openai-structured-outputs-json-schemas-in-a-tool-call
1114
func toOpenAITools(strict: Bool = false) -> [AIProxyOpenAITool] {
@@ -22,11 +25,11 @@ extension ToolContainer {
2225
}
2326

2427
// https://github.com/lzell/AIProxySwift?tab=readme-ov-file#how-to-use-streaming-tool-calls-with-anthropic
25-
func toAnthropicTools() -> [AnthropicTool] {
28+
func toAnthropicTools() -> [AIProxyAnthropicTool] {
2629
guard let allTools else { return [] }
2730

2831
return allTools.map { tool in
29-
AnthropicTool(
32+
AIProxyAnthropicTool(
3033
description: tool.description,
3134
inputSchema: tool.inputSchema.toJSONSchema(),
3235
name: tool.name
@@ -36,11 +39,11 @@ extension ToolContainer {
3639

3740
// swiftlint:disable:next line_length
3841
// https://github.com/lzell/AIProxySwift?tab=readme-ov-file#how-to-make-a-tool-call-request-with-llama-and-togetherai
39-
func toTogetherAITools() -> [TogetherAITool] {
42+
func toTogetherAITools() -> [AIProxyTogetherAITool] {
4043
guard let allTools else { return [] }
4144

4245
return allTools.map { tool in
43-
TogetherAITool(
46+
AIProxyTogetherAITool(
4447
function: .init(
4548
description: tool.description,
4649
name: tool.name,

0 commit comments

Comments
 (0)