opik 1.8.87 → 1.8.91
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 +6 -47
- package/dist/index.cjs +337 -11
- package/dist/index.d.cts +10722 -48
- package/dist/index.d.ts +10722 -48
- package/dist/index.js +339 -1
- package/package.json +8 -12
- package/dist/Client-BMjFLeAt.d.cts +0 -9345
- package/dist/Client-BMjFLeAt.d.ts +0 -9345
- package/dist/chunk-K5L6K4RC.js +0 -13
- package/dist/vercel/index.cjs +0 -13
- package/dist/vercel/index.d.cts +0 -47
- package/dist/vercel/index.d.ts +0 -47
- package/dist/vercel/index.js +0 -1
package/README.md
CHANGED
|
@@ -103,55 +103,14 @@ for (let i = 0; i < 10; i++) {
|
|
|
103
103
|
await client.flush();
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
##
|
|
106
|
+
## Integrations
|
|
107
107
|
|
|
108
|
-
Opik provides seamless
|
|
108
|
+
Opik provides seamless integrations with popular AI frameworks and tools. Check out our integration packages:
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
npm install opik ai @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Usage
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
import { openai } from "@ai-sdk/openai";
|
|
122
|
-
import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
|
|
123
|
-
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
124
|
-
import { generateText } from "ai";
|
|
125
|
-
import { OpikExporter } from "opik/vercel";
|
|
126
|
-
|
|
127
|
-
const sdk = new NodeSDK({
|
|
128
|
-
traceExporter: new OpikExporter(),
|
|
129
|
-
instrumentations: [getNodeAutoInstrumentations()],
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
sdk.start();
|
|
133
|
-
|
|
134
|
-
const { text } = await generateText({
|
|
135
|
-
model: openai("gpt-4o-mini"),
|
|
136
|
-
prompt: "What is love? Describe it in 10 words or less.",
|
|
137
|
-
experimental_telemetry: OpikExporter.getSettings({
|
|
138
|
-
name: "ai-sdk-integration",
|
|
139
|
-
}),
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
await sdk.shutdown();
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
This integration automatically captures:
|
|
146
|
-
|
|
147
|
-
- Input prompts and messages
|
|
148
|
-
- Model responses
|
|
149
|
-
- Token usage statistics
|
|
150
|
-
- Tool calls and their results
|
|
151
|
-
- Timing information
|
|
152
|
-
- Error states
|
|
153
|
-
|
|
154
|
-
All this telemetry data is automatically sent to your Opik project for analysis and monitoring.
|
|
110
|
+
- **Vercel AI** - [`opik-vercel`](https://www.npmjs.com/package/opik-vercel)
|
|
111
|
+
- **OpenAI** - [`opik-openai`](https://www.npmjs.com/package/opik-openai)
|
|
112
|
+
- **LangChain** - [`opik-langchain`](https://www.npmjs.com/package/opik-langchain)
|
|
113
|
+
- **Google Gemini** - [`opik-gemini`](https://www.npmjs.com/package/opik-gemini)
|
|
155
114
|
|
|
156
115
|
## Contributing
|
|
157
116
|
|