Skip to content

Commit 20f39a5

Browse files
committed
rename to parameters
1 parent 949d8a0 commit 20f39a5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/tool-helpers-json-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function main() {
1717
betaFunctionTool({
1818
name: 'getWeather',
1919
description: 'Get the weather at a specific location',
20-
inputSchema: {
20+
parameters: {
2121
type: 'object',
2222
properties: {
2323
location: {

src/helpers/beta/json-schema.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ export function betaFunctionTool<
1414
const Schema extends Exclude<JSONSchema, boolean> & { type: 'object' },
1515
>(options: {
1616
name: string;
17-
inputSchema: Schema;
17+
parameters: Schema;
1818
description: string;
1919
run: (args: NoInfer<FromSchema<Schema>>) => Promisable<string | Array<FunctionTool>>;
2020
}): BetaRunnableChatCompletionFunctionTool<NoInfer<FromSchema<Schema>>> {
21-
if (options.inputSchema.type !== 'object') {
21+
if (options.parameters.type !== 'object') {
2222
throw new OpenAIError(
23-
`JSON schema for tool "${options.name}" must be an object, but got ${options.inputSchema.type}`,
23+
`JSON schema for tool "${options.name}" must be an object, but got ${options.parameters.type}`,
2424
);
2525
}
2626

2727
return {
2828
type: 'function',
2929
function: {
3030
name: options.name,
31-
parameters: options.inputSchema,
31+
parameters: options.parameters,
3232
description: options.description,
3333
},
3434
run: options.run,

0 commit comments

Comments
 (0)