File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,19 @@ const thread = await client.thread({ id: uuidv4(), participantId }).upsert();
42
42
``` ts
43
43
// Create the first step
44
44
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
+ })
46
50
.send ();
47
51
52
+
48
53
// Create a child llm step
49
54
const step = step .step ({
50
55
name: ' gpt-4' ,
51
56
type: ' llm' ,
52
- input: ' Hello'
57
+ input: { text: ' Hello' }
53
58
});
54
59
55
60
const stream = await openai .chat .completions .create ({
@@ -58,13 +63,6 @@ const stream = await openai.chat.completions.create({
58
63
messages: [{ role: ' user' , content: ' Say this is a test' }]
59
64
});
60
65
61
- // Create a child llm step
62
- const step = step .step ({
63
- name: ' gpt-4' ,
64
- type: ' llm' ,
65
- input: ' Hello'
66
- });
67
-
68
66
// Instrument the openai response
69
67
await client .instrumentation .openai (step , stream );
70
68
@@ -107,7 +105,7 @@ const score = await client.api.createScore({
107
105
stepId: finalStep .id ! ,
108
106
name: ' user-feedback' ,
109
107
value: 1 ,
110
- type: ' Human ' ,
108
+ type: ' HUMAN ' ,
111
109
comment: ' Great!'
112
110
});
113
111
```
You can’t perform that action at this time.
0 commit comments