opik 0.0.5 → 0.0.7
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 +66 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<h1 align="center" style="border-bottom: none">
|
|
2
|
+
<div>
|
|
3
|
+
<a href="https://www.comet.com/site/products/opik/?from=llm&utm_source=opik&utm_medium=github&utm_content=header_img&utm_campaign=opik"><picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="/apps/opik-documentation/documentation/static/img/logo-dark-mode.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/comet-ml/opik/blob/HEAD/apps/opik-documentation/documentation/static/img/opik-logo.svg">
|
|
6
|
+
<img alt="Comet Opik logo" src="https://github.com/comet-ml/opik/blob/HEAD/apps/opik-documentation/documentation/static/img/opik-logo.svg" width="200" />
|
|
7
|
+
</picture></a>
|
|
8
|
+
<br>
|
|
9
|
+
Opik
|
|
10
|
+
</div>
|
|
11
|
+
Open source LLM evaluation framework<br>
|
|
12
|
+
</h1>
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
You can install the `opik` package using your favorite package manager.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install opik
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { Opik } from "opik";
|
|
26
|
+
|
|
27
|
+
// Create a new Opik client with your configuration
|
|
28
|
+
const client = new Opik({
|
|
29
|
+
apiKey: "<your-api-key>",
|
|
30
|
+
host: "https://www.comet.com/opik/api",
|
|
31
|
+
projectName: "<your-project-name>",
|
|
32
|
+
workspaceName: "<your-workspace-name>",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Log 10 traces
|
|
36
|
+
for (let i = 0; i < 10; i++) {
|
|
37
|
+
const someTrace = client.trace({
|
|
38
|
+
name: `Trace ${i}`,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// For each trace, log 10 spans
|
|
42
|
+
for (let j = 0; j < 10; j++) {
|
|
43
|
+
const someSpan = someTrace.span({
|
|
44
|
+
name: `Span ${i}-${j}`,
|
|
45
|
+
type: "llm",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Mark the span as ended
|
|
49
|
+
someSpan.end();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Mark the trace as ended
|
|
53
|
+
someTrace.end();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Flush the client to send all traces and spans
|
|
57
|
+
await client.flush();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Contributing
|
|
61
|
+
|
|
62
|
+
Contributions are welcome! If you have any suggestions or improvements, please feel free to open an [issue](https://github.com/comet-ml/opik/issues) or submit a [pull request](https://github.com/comet-ml/opik/pulls).
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
This project is licensed under the [Apache License 2.0](https://github.com/comet-ml/opik/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opik",
|
|
3
3
|
"description": "Opik TypeScript and JavaScript SDK",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/comet-ml/opik.git",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"comet"
|
|
29
29
|
],
|
|
30
30
|
"files": [
|
|
31
|
-
"dist/**/*"
|
|
31
|
+
"dist/**/*",
|
|
32
|
+
"README.md"
|
|
32
33
|
],
|
|
33
34
|
"exports": {
|
|
34
35
|
"./package.json": "./package.json",
|