@singlestore/ai
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -15,3 +15,3 @@ import z$1, { z } from 'zod'; | ||
description: string; | ||
schema?: U; | ||
params?: U; | ||
call: K; | ||
@@ -24,3 +24,3 @@ } | ||
description: string; | ||
schema: U; | ||
params: U; | ||
call: K; | ||
@@ -47,6 +47,6 @@ constructor(config: ChatCompletionToolConfig<T, U, K>); | ||
toolCallHandlers?: U extends AnyChatCompletionTool[] ? { | ||
[K in U[number] as K["name"]]?: (tool: K, params: K["schema"] extends z$1.AnyZodObject ? z$1.infer<K["schema"]> : undefined) => Promise<void>; | ||
[K in U[number] as K["name"]]?: (tool: K, params: K["params"] extends z$1.AnyZodObject ? z$1.infer<K["params"]> : undefined) => Promise<void>; | ||
} : undefined; | ||
toolCallResultHandlers?: U extends AnyChatCompletionTool[] ? { | ||
[K in U[number] as K["name"]]?: (tool: K, result: Awaited<ReturnType<K["call"]>>, params: K["schema"] extends z$1.AnyZodObject ? z$1.infer<K["schema"]> : undefined) => Promise<void>; | ||
[K in U[number] as K["name"]]?: (tool: K, result: Awaited<ReturnType<K["call"]>>, params: K["params"] extends z$1.AnyZodObject ? z$1.infer<K["params"]> : undefined) => Promise<void>; | ||
} : undefined; | ||
@@ -53,0 +53,0 @@ } |
@@ -105,5 +105,5 @@ "use strict"; | ||
messages: _messages, | ||
tools: _tools.length ? _tools.map(({ name, description, schema }) => ({ | ||
tools: _tools.length ? _tools.map(({ name, description, params: params2 }) => ({ | ||
type: "function", | ||
function: { name, description, parameters: schema ? (0, import_zod_to_json_schema.default)(schema) : void 0 } | ||
function: { name, description, parameters: params2 ? (0, import_zod_to_json_schema.default)(params2) : void 0 } | ||
})) : void 0 | ||
@@ -215,3 +215,3 @@ }); | ||
description; | ||
schema; | ||
params; | ||
call; | ||
@@ -221,3 +221,3 @@ constructor(config) { | ||
this.description = config.description; | ||
this.schema = config.schema; | ||
this.params = config.params; | ||
this.call = config.call; | ||
@@ -224,0 +224,0 @@ } |
{ | ||
"name": "@singlestore/ai", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68969