@tstdl/base 0.92.21 → 0.92.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/types.d.ts +3 -3
- package/ai/types.js +2 -2
- package/package.json +1 -1
package/ai/types.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export type GenerationResult = {
|
|
|
82
82
|
finishReason: FinishReason;
|
|
83
83
|
usage: GenerationUsage;
|
|
84
84
|
};
|
|
85
|
-
export declare function
|
|
86
|
-
export declare function
|
|
87
|
-
export declare function
|
|
85
|
+
export declare function defineFunctions<T extends SchemaFunctionDeclarations>(declarations: T): T;
|
|
86
|
+
export declare function defineFunction<T extends Record = Record>(description: string, parameters: ValueOrAsyncProvider<ObjectSchema<T>>): SchemaFunctionDeclaration<T, never>;
|
|
87
|
+
export declare function defineFunction<T extends Record = Record, R = never>(description: string, parameters: ValueOrAsyncProvider<ObjectSchema<T>>, handler: (parameters: T) => R | Promise<R>): SchemaFunctionDeclaration<T, R>;
|
|
88
88
|
export declare function isSchemaFunctionDeclarationWithHandler(declaration: SchemaFunctionDeclaration): declaration is SchemaFunctionDeclarationWithHandler;
|
package/ai/types.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { hasOwnProperty } from '../utils/object/object.js';
|
|
2
2
|
import { isDefined } from '../utils/type-guards.js';
|
|
3
|
-
export function
|
|
3
|
+
export function defineFunctions(declarations) {
|
|
4
4
|
return declarations;
|
|
5
5
|
}
|
|
6
|
-
export function
|
|
6
|
+
export function defineFunction(description, parameters, handler) {
|
|
7
7
|
if (isDefined(handler)) {
|
|
8
8
|
return { description, parameters, handler };
|
|
9
9
|
}
|