Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/agent-patterns/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
StreamedRunResult,
} from '@openai/agents';
import readline from 'node:readline/promises';
import { randomUUID } from 'crypto';
import { randomUUID } from 'node:crypto';

const rl = readline.createInterface({
input: process.stdin,
Expand Down
6 changes: 2 additions & 4 deletions examples/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { Agent, run, tool } from '@openai/agents';
const getWeatherTool = tool({
name: 'get_weather',
description: 'Get the weather for a given city',
parameters: z.object({
demo: z.string(),
}),
parameters: z.object({ city: z.string() }),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency

execute: async (input) => {
return `The weather in ${input.demo} is sunny`;
return `The weather in ${input.city} is sunny`;
},
});

Expand Down
4 changes: 2 additions & 2 deletions examples/basic/local-image.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
import { Agent, run } from '@openai/agents';

const bisonImagePath = path.join(__dirname, 'media/image_bison.jpg');
Expand Down
2 changes: 1 addition & 1 deletion examples/customer-service/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from 'zod';
import readline from 'readline';
import readline from 'node:readline';
import { Agent, withTrace, tool, run, RunContext } from '@openai/agents';
import { RECOMMENDED_PROMPT_PREFIX } from '@openai/agents-core/extensions';

Expand Down
2 changes: 0 additions & 2 deletions examples/docs/models/customProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import {
ModelProvider,
Model,
ModelRequest,
AgentOutputType,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

ModelResponse,
ResponseStreamEvent,
TextOutput,
} from '@openai/agents-core';

import { Agent, Runner } from '@openai/agents';
Expand Down
4 changes: 2 additions & 2 deletions examples/docs/streaming/streamedHITL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ while (stream.interruptions?.length) {
);
const state = stream.state;
for (const interruption of stream.interruptions) {
const ok = await confirm(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dom confirm is not an async function

const approved = confirm(
`Agent ${interruption.agent.name} would like to use the tool ${interruption.rawItem.name} with "${interruption.rawItem.arguments}". Do you approve?`,
);
if (ok) {
if (approved) {
state.approve(interruption);
} else {
state.reject(interruption);
Expand Down
2 changes: 1 addition & 1 deletion examples/research-bot/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ResearchManager } from './manager';

async function main() {
const readline = await import('readline');
const readline = await import('node:readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
Expand Down
8 changes: 4 additions & 4 deletions examples/tools/image-generation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Agent, run, imageGenerationTool, withTrace } from '@openai/agents';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import { spawnSync } from 'child_process';
import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import { spawnSync } from 'node:child_process';

function openFile(filePath: string): void {
if (process.platform === 'darwin') {
Expand Down