File tree Expand file tree Collapse file tree 1 file changed +0
-7
lines changed
Expand file tree Collapse file tree 1 file changed +0
-7
lines changed Original file line number Diff line number Diff line change 11import type { FromSchema , JSONSchema } from 'json-schema-to-ts' ;
22import type { BetaRunnableChatCompletionFunctionTool , Promisable } from '../../lib/beta/BetaRunnableTool' ;
33import type { FunctionTool } from '../../resources/beta' ;
4- import { OpenAIError } from '../../error' ;
54
65type 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 : {
You can’t perform that action at this time.
0 commit comments