Skip to content

Commit ec31a58

Browse files
committed
allow object
1 parent 20f39a5 commit ec31a58

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/helpers/beta/json-schema.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { FromSchema, JSONSchema } from 'json-schema-to-ts';
22
import type { BetaRunnableChatCompletionFunctionTool, Promisable } from '../../lib/beta/BetaRunnableTool';
33
import type { FunctionTool } from '../../resources/beta';
4-
import { OpenAIError } from '../../error';
54

65
type NoInfer<T> = T extends infer R ? R : never;
76

@@ -18,12 +17,6 @@ export function betaFunctionTool<
1817
description: string;
1918
run: (args: NoInfer<FromSchema<Schema>>) => Promisable<string | Array<FunctionTool>>;
2019
}): BetaRunnableChatCompletionFunctionTool<NoInfer<FromSchema<Schema>>> {
21-
if (options.parameters.type !== 'object') {
22-
throw new OpenAIError(
23-
`JSON schema for tool "${options.name}" must be an object, but got ${options.parameters.type}`,
24-
);
25-
}
26-
2720
return {
2821
type: 'function',
2922
function: {

0 commit comments

Comments
 (0)