Skip to content

Commit b0f8818

Browse files
committed
improve names
1 parent 1066d30 commit b0f8818

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/tool-helpers-json-schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env -S npm run tsn -T
22

33
import OpenAI from 'openai';
4-
import { betaTool } from 'openai/helpers/beta/json-schema';
4+
import { betaFunctionTool } from 'openai/helpers/beta/json-schema';
55

66
const client = new OpenAI();
77

@@ -14,7 +14,7 @@ async function main() {
1414
},
1515
],
1616
tools: [
17-
betaTool({
17+
betaFunctionTool({
1818
name: 'getWeather',
1919
description: 'Get the weather at a specific location',
2020
inputSchema: {

src/helpers/beta/json-schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ type NoInfer<T> = T extends infer R ? R : never;
1010
* to the `.toolRunner()` method. The schema is used to automatically validate
1111
* the input arguments for the tool.
1212
*/
13-
export function betaTool<const Schema extends Exclude<JSONSchema, boolean> & { type: 'object' }>(options: {
13+
export function betaFunctionTool<
14+
const Schema extends Exclude<JSONSchema, boolean> & { type: 'object' },
15+
>(options: {
1416
name: string;
1517
inputSchema: Schema;
1618
description: string;

0 commit comments

Comments
 (0)