@tstdl/base 0.92.23 → 0.92.25
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 +5 -3
- package/ai/types.js +2 -6
- package/package.json +1 -1
package/ai/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LiteralUnion } from 'type-fest';
|
|
2
|
-
import type
|
|
2
|
+
import { type ObjectSchema, type SchemaOutput, type SchemaTestable } from '../schema/index.js';
|
|
3
3
|
import type { Record, UndefinableJsonObject } from '../types.js';
|
|
4
4
|
import type { ResolvedValueOrProvider, ValueOrAsyncProvider } from '../utils/value-or-provider.js';
|
|
5
5
|
export type FileInput = {
|
|
@@ -84,6 +84,8 @@ export type GenerationResult = {
|
|
|
84
84
|
usage: GenerationUsage;
|
|
85
85
|
};
|
|
86
86
|
export declare function defineFunctions<T extends SchemaFunctionDeclarations>(declarations: T): T;
|
|
87
|
-
export declare function defineFunction<
|
|
88
|
-
|
|
87
|
+
export declare function defineFunction<P extends Record, T extends SchemaFunctionDeclarationWithHandler<P>>(declaration: T & {
|
|
88
|
+
parameters: ObjectSchema<P>;
|
|
89
|
+
}): T;
|
|
90
|
+
export declare function defineFunction<T extends SchemaFunctionDeclarationWithoutHandler>(declaration: T): T;
|
|
89
91
|
export declare function isSchemaFunctionDeclarationWithHandler(declaration: SchemaFunctionDeclaration): declaration is SchemaFunctionDeclarationWithHandler;
|
package/ai/types.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { hasOwnProperty } from '../utils/object/object.js';
|
|
2
|
-
import { isDefined } from '../utils/type-guards.js';
|
|
3
2
|
export function defineFunctions(declarations) {
|
|
4
3
|
return declarations;
|
|
5
4
|
}
|
|
6
|
-
export function defineFunction(
|
|
7
|
-
|
|
8
|
-
return { description, parameters, handler };
|
|
9
|
-
}
|
|
10
|
-
return { description, parameters };
|
|
5
|
+
export function defineFunction(declaration) {
|
|
6
|
+
return declaration;
|
|
11
7
|
}
|
|
12
8
|
export function isSchemaFunctionDeclarationWithHandler(declaration) {
|
|
13
9
|
return hasOwnProperty(declaration, 'handler');
|