From a739255596c436db294ddd5760e4d4674baa70c5 Mon Sep 17 00:00:00 2001 From: Damien BUTY Date: Fri, 17 May 2024 18:22:24 +0200 Subject: [PATCH] docs: fix some broken examples in the README --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 245a0db..4d04806 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,19 @@ const thread = await client.thread({ id: uuidv4(), participantId }).upsert(); ```ts // Create the first step const step = await thread - .step({ name: userIdentifier, type: 'user_message', output: 'Hello' }) + .step({ + name: userIdentifier, + type: 'user_message', + output: { text: 'Hello' }, + }) .send(); + // Create a child llm step const step = step.step({ name: 'gpt-4', type: 'llm', - input: 'Hello' + input: { text: 'Hello' } }); const stream = await openai.chat.completions.create({ @@ -58,13 +63,6 @@ const stream = await openai.chat.completions.create({ messages: [{ role: 'user', content: 'Say this is a test' }] }); -// Create a child llm step -const step = step.step({ - name: 'gpt-4', - type: 'llm', - input: 'Hello' -}); - // Instrument the openai response await client.instrumentation.openai(step, stream); @@ -107,7 +105,7 @@ const score = await client.api.createScore({ stepId: finalStep.id!, name: 'user-feedback', value: 1, - type: 'Human', + type: 'HUMAN', comment: 'Great!' }); ```