Skip to content

docs: fix some broken examples in the README #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2024
Merged
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
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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);

Expand Down Expand Up @@ -107,7 +105,7 @@ const score = await client.api.createScore({
stepId: finalStep.id!,
name: 'user-feedback',
value: 1,
type: 'Human',
type: 'HUMAN',
comment: 'Great!'
});
```
Expand Down
Loading