Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: fix some broken examples in the README (#23)
Browse files Browse the repository at this point in the history
Dam-Buty authored May 20, 2024

Verified

This commit was signed with the committer’s verified signature.
1 parent e3049d2 commit e2ced40
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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!'
});
```

0 comments on commit e2ced40

Please sign in to comment.