diff --git a/examples/bug-fixer/fixer.ts b/examples/bug-fixer/fixer.ts index c5a9c3b..147da55 100644 --- a/examples/bug-fixer/fixer.ts +++ b/examples/bug-fixer/fixer.ts @@ -148,12 +148,14 @@ export async function chat( let response = ''; const printer = onOutput || createStreamPrinter(); - for await (const msg of session.receive()) { + for await (const msg of session.stream()) { if (msg.type === 'assistant') { response += msg.content; printer(msg.content); } else if (msg.type === 'tool_call') { - console.log(`\n${COLORS.system}[${msg.name}]${COLORS.reset}`); + // @ts-ignore - tool name might be in different places + const toolName = msg.name || msg.tool || 'tool'; + console.log(`\n${COLORS.system}[${toolName}]${COLORS.reset}`); } else if (msg.type === 'tool_result') { console.log(`${COLORS.system}[done]${COLORS.reset}\n`); } diff --git a/examples/bug-fixer/types.ts b/examples/bug-fixer/types.ts index 7b628d5..586340d 100644 --- a/examples/bug-fixer/types.ts +++ b/examples/bug-fixer/types.ts @@ -12,5 +12,5 @@ export interface BugFixerConfig { } export const DEFAULT_CONFIG: BugFixerConfig = { - model: 'sonnet', + model: 'haiku', }; diff --git a/examples/file-organizer/organizer.ts b/examples/file-organizer/organizer.ts index 72af7e4..b5d432f 100644 --- a/examples/file-organizer/organizer.ts +++ b/examples/file-organizer/organizer.ts @@ -142,7 +142,7 @@ export async function chat( let response = ''; const printer = onOutput || createStreamPrinter(); - for await (const msg of session.receive()) { + for await (const msg of session.stream()) { if (msg.type === 'assistant') { response += msg.content; printer(msg.content); diff --git a/examples/file-organizer/types.ts b/examples/file-organizer/types.ts index 842fa17..1ecee51 100644 --- a/examples/file-organizer/types.ts +++ b/examples/file-organizer/types.ts @@ -12,5 +12,5 @@ export interface FileOrganizerConfig { } export const DEFAULT_CONFIG: FileOrganizerConfig = { - model: 'sonnet', + model: 'haiku', }; diff --git a/examples/release-notes/generator.ts b/examples/release-notes/generator.ts index 6145f81..d30242e 100644 --- a/examples/release-notes/generator.ts +++ b/examples/release-notes/generator.ts @@ -154,7 +154,7 @@ export async function chat( let response = ''; const printer = onOutput || createStreamPrinter(); - for await (const msg of session.receive()) { + for await (const msg of session.stream()) { if (msg.type === 'assistant') { response += msg.content; printer(msg.content); diff --git a/examples/release-notes/types.ts b/examples/release-notes/types.ts index b88a7a8..440f3d6 100644 --- a/examples/release-notes/types.ts +++ b/examples/release-notes/types.ts @@ -12,5 +12,5 @@ export interface ReleaseNotesConfig { } export const DEFAULT_CONFIG: ReleaseNotesConfig = { - model: 'sonnet', + model: 'haiku', };