opik 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,12 @@ const client = new Opik({
|
|
|
36
36
|
for (let i = 0; i < 10; i++) {
|
|
37
37
|
const someTrace = client.trace({
|
|
38
38
|
name: `Trace ${i}`,
|
|
39
|
+
input: {
|
|
40
|
+
prompt: `Hello, world! ${i}`,
|
|
41
|
+
},
|
|
42
|
+
output: {
|
|
43
|
+
response: `Hello, world! ${i}`,
|
|
44
|
+
},
|
|
39
45
|
});
|
|
40
46
|
|
|
41
47
|
// For each trace, log 10 spans
|
|
@@ -43,8 +49,17 @@ for (let i = 0; i < 10; i++) {
|
|
|
43
49
|
const someSpan = someTrace.span({
|
|
44
50
|
name: `Span ${i}-${j}`,
|
|
45
51
|
type: "llm",
|
|
52
|
+
input: {
|
|
53
|
+
prompt: `Hello, world! ${i}:${j}`,
|
|
54
|
+
},
|
|
55
|
+
output: {
|
|
56
|
+
response: `Hello, world! ${i}:${j}`,
|
|
57
|
+
},
|
|
46
58
|
});
|
|
47
59
|
|
|
60
|
+
// Some LLM work
|
|
61
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
62
|
+
|
|
48
63
|
// Mark the span as ended
|
|
49
64
|
someSpan.end();
|
|
50
65
|
}
|