Skip to content

Commit e2ced40

Browse files
authored
docs: fix some broken examples in the README (#23)
1 parent e3049d2 commit e2ced40

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,19 @@ const thread = await client.thread({ id: uuidv4(), participantId }).upsert();
4242
```ts
4343
// Create the first step
4444
const step = await thread
45-
.step({ name: userIdentifier, type: 'user_message', output: 'Hello' })
45+
.step({
46+
name: userIdentifier,
47+
type: 'user_message',
48+
output: { text: 'Hello' },
49+
})
4650
.send();
4751

52+
4853
// Create a child llm step
4954
const step = step.step({
5055
name: 'gpt-4',
5156
type: 'llm',
52-
input: 'Hello'
57+
input: { text: 'Hello' }
5358
});
5459

5560
const stream = await openai.chat.completions.create({
@@ -58,13 +63,6 @@ const stream = await openai.chat.completions.create({
5863
messages: [{ role: 'user', content: 'Say this is a test' }]
5964
});
6065

61-
// Create a child llm step
62-
const step = step.step({
63-
name: 'gpt-4',
64-
type: 'llm',
65-
input: 'Hello'
66-
});
67-
6866
// Instrument the openai response
6967
await client.instrumentation.openai(step, stream);
7068

@@ -107,7 +105,7 @@ const score = await client.api.createScore({
107105
stepId: finalStep.id!,
108106
name: 'user-feedback',
109107
value: 1,
110-
type: 'Human',
108+
type: 'HUMAN',
111109
comment: 'Great!'
112110
});
113111
```

0 commit comments

Comments
 (0)