opik 0.2.0 → 0.3.0
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 +7 -5
- package/dist/{Client-DilyWTdT.d.cts → Client-CI4BzUKl.d.cts} +3 -1
- package/dist/{Client-DilyWTdT.d.ts → Client-CI4BzUKl.d.ts} +3 -1
- package/dist/Node18UniversalStreamWrapper-GZXI7BSF.js +1 -0
- package/dist/NodePre18StreamWrapper-TZYQXHQT.js +1 -0
- package/dist/UndiciStreamWrapper-4QYH36IP.js +1 -0
- package/dist/chunk-VUPTLXYD.js +4 -0
- package/dist/chunk-WOT6VMZA.js +1 -0
- package/dist/index.cjs +4 -13021
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -4
- package/dist/vercel/index.cjs +4 -13037
- package/dist/vercel/index.d.cts +1 -1
- package/dist/vercel/index.d.ts +1 -1
- package/dist/vercel/index.js +1 -207
- package/package.json +9 -2
- package/dist/Node18UniversalStreamWrapper-CE7OKAXD.js +0 -217
- package/dist/Node18UniversalStreamWrapper-CE7OKAXD.js.map +0 -1
- package/dist/NodePre18StreamWrapper-TYJO3GAZ.js +0 -89
- package/dist/NodePre18StreamWrapper-TYJO3GAZ.js.map +0 -1
- package/dist/UndiciStreamWrapper-UCC32KBP.js +0 -205
- package/dist/UndiciStreamWrapper-UCC32KBP.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -9
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-ZB4ZJRLY.js +0 -12479
- package/dist/chunk-ZB4ZJRLY.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/vercel/index.cjs.map +0 -1
- package/dist/vercel/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -23,11 +23,13 @@ npm install opik
|
|
|
23
23
|
|
|
24
24
|
You can configure the Opik client using environment variables.
|
|
25
25
|
|
|
26
|
+
`.env` file:
|
|
27
|
+
|
|
26
28
|
```bash
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
OPIK_API_KEY="your-api-key"
|
|
30
|
+
OPIK_URL_OVERRIDE="https://www.comet.com/opik/api"
|
|
31
|
+
OPIK_PROJECT_NAME="your-project-name"
|
|
32
|
+
OPIK_WORKSPACE_NAME="your-workspace-name"
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
Or you can pass the configuration to the Opik client constructor.
|
|
@@ -37,7 +39,7 @@ import { Opik } from "opik";
|
|
|
37
39
|
|
|
38
40
|
const client = new Opik({
|
|
39
41
|
apiKey: "<your-api-key>",
|
|
40
|
-
|
|
42
|
+
apiUrl: "https://www.comet.com/opik/api",
|
|
41
43
|
projectName: "<your-project-name>",
|
|
42
44
|
workspaceName: "<your-workspace-name>",
|
|
43
45
|
});
|
|
@@ -2,7 +2,7 @@ import * as stream from 'stream';
|
|
|
2
2
|
|
|
3
3
|
interface OpikConfig {
|
|
4
4
|
apiKey: string;
|
|
5
|
-
|
|
5
|
+
apiUrl?: string;
|
|
6
6
|
projectName: string;
|
|
7
7
|
workspaceName: string;
|
|
8
8
|
}
|
|
@@ -4787,7 +4787,9 @@ declare class OpikClient {
|
|
|
4787
4787
|
traceBatchQueue: TraceBatchQueue;
|
|
4788
4788
|
spanFeedbackScoresBatchQueue: SpanFeedbackScoresBatchQueue;
|
|
4789
4789
|
traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
|
|
4790
|
+
private lastProjectNameLogged;
|
|
4790
4791
|
constructor(explicitConfig?: Partial<OpikConfig>);
|
|
4792
|
+
private displayTraceLog;
|
|
4791
4793
|
trace: (traceData: TraceData) => Trace;
|
|
4792
4794
|
flush: () => Promise<void>;
|
|
4793
4795
|
}
|
|
@@ -2,7 +2,7 @@ import * as stream from 'stream';
|
|
|
2
2
|
|
|
3
3
|
interface OpikConfig {
|
|
4
4
|
apiKey: string;
|
|
5
|
-
|
|
5
|
+
apiUrl?: string;
|
|
6
6
|
projectName: string;
|
|
7
7
|
workspaceName: string;
|
|
8
8
|
}
|
|
@@ -4787,7 +4787,9 @@ declare class OpikClient {
|
|
|
4787
4787
|
traceBatchQueue: TraceBatchQueue;
|
|
4788
4788
|
spanFeedbackScoresBatchQueue: SpanFeedbackScoresBatchQueue;
|
|
4789
4789
|
traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
|
|
4790
|
+
private lastProjectNameLogged;
|
|
4790
4791
|
constructor(explicitConfig?: Partial<OpikConfig>);
|
|
4792
|
+
private displayTraceLog;
|
|
4791
4793
|
trace: (traceData: TraceData) => Trace;
|
|
4792
4794
|
flush: () => Promise<void>;
|
|
4793
4795
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-WOT6VMZA.js';var s=class t{constructor(e){this.readableStream=e,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=false,this.resumeCallback=null,this.encoding=null;}on(e,r){var a;(a=this.events[e])==null||a.push(r);}off(e,r){var a;this.events[e]=(a=this.events[e])==null?void 0:a.filter(i=>i!==r);}pipe(e){return this.on("data",async r=>{if(e instanceof t)e._write(r);else if(e instanceof WritableStream){let a=e.getWriter();a.write(r).then(()=>a.releaseLock());}else e.write(r);}),this.on("end",async()=>{e instanceof t?e._end():e instanceof WritableStream?e.getWriter().close():e.end();}),this.on("error",async r=>{e instanceof t?e._error(r):e instanceof WritableStream?e.getWriter().abort(r):e.destroy(r);}),this._startReading(),e}pipeTo(e){return this.pipe(e)}unpipe(e){this.off("data",async r=>{if(e instanceof t)e._write(r);else if(e instanceof WritableStream){let a=e.getWriter();a.write(r).then(()=>a.releaseLock());}else e.write(r);}),this.off("end",async()=>{e instanceof t?e._end():e instanceof WritableStream?e.getWriter().close():e.end();}),this.off("error",async r=>{e instanceof t?e._error(r):e instanceof WritableStream?e.getWriter().abort(r):e.destroy(r);});}destroy(e){this.reader.cancel(e).then(()=>{this._emit("close");}).catch(r=>{this._emit("error",r);});}pause(){this.paused=true,this._emit("pause");}resume(){this.paused&&(this.paused=false,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null));}get isPaused(){return this.paused}async read(){this.paused&&await new Promise(a=>{this.resumeCallback=a;});let{done:e,value:r}=await this.reader.read();if(!e)return r}setEncoding(e){this.encoding=e;}async text(){let e=[];for(;;){let{done:a,value:i}=await this.reader.read();if(a)break;i&&e.push(i);}return new TextDecoder(this.encoding||"utf-8").decode(await new Blob(e).arrayBuffer())}async json(){let e=await this.text();return JSON.parse(e)}_write(e){this._emit("data",e);}_end(){this._emit("end");}_error(e){this._emit("error",e);}_emit(e,r){if(this.events[e])for(let a of this.events[e]||[])a(r);}async _startReading(){try{for(this._emit("readable");;){this.paused&&await new Promise(a=>{this.resumeCallback=a;});let{done:e,value:r}=await this.reader.read();if(e){this._emit("end"),this._emit("close");break}r&&this._emit("data",r);}}catch(e){this._emit("error",e);}}[Symbol.asyncIterator](){return {next:async()=>{this.paused&&await new Promise(a=>{this.resumeCallback=a;});let{done:e,value:r}=await this.reader.read();return e?{done:true,value:void 0}:{done:false,value:r}},[Symbol.asyncIterator](){return this}}}};export{s as Node18UniversalStreamWrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-WOT6VMZA.js';var i=class{constructor(e){this.readableStream=e;}on(e,r){this.readableStream.on(e,r);}off(e,r){this.readableStream.off(e,r);}pipe(e){return this.readableStream.pipe(e),e}pipeTo(e){return this.pipe(e)}unpipe(e){e?this.readableStream.unpipe(e):this.readableStream.unpipe();}destroy(e){this.readableStream.destroy(e);}pause(){this.readableStream.pause();}resume(){this.readableStream.resume();}get isPaused(){return this.readableStream.isPaused()}async read(){return new Promise((e,r)=>{let a=this.readableStream.read();a?e(a):(this.readableStream.once("readable",()=>{let t=this.readableStream.read();e(t);}),this.readableStream.once("error",r));})}setEncoding(e){this.readableStream.setEncoding(e),this.encoding=e;}async text(){let e=[],r=new TextEncoder;this.readableStream.setEncoding(this.encoding||"utf-8");for await(let t of this.readableStream)e.push(r.encode(t));return new TextDecoder(this.encoding||"utf-8").decode(Buffer.concat(e))}async json(){let e=await this.text();return JSON.parse(e)}[Symbol.asyncIterator](){let r=this.readableStream[Symbol.asyncIterator]();return {async next(){let{value:a,done:t}=await r.next();return {value:a,done:t}},[Symbol.asyncIterator](){return this}}}};export{i as NodePre18StreamWrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-WOT6VMZA.js';var s=class a{constructor(e){this.readableStream=e,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=false,this.resumeCallback=null,this.encoding=null;}on(e,r){var t;(t=this.events[e])==null||t.push(r);}off(e,r){var t;this.events[e]=(t=this.events[e])==null?void 0:t.filter(i=>i!==r);}pipe(e){return this.on("data",r=>{if(e instanceof a)e._write(r);else {let t=e.getWriter();t.write(r).then(()=>t.releaseLock());}}),this.on("end",()=>{e instanceof a?e._end():e.getWriter().close();}),this.on("error",r=>{e instanceof a?e._error(r):e.getWriter().abort(r);}),this._startReading(),e}pipeTo(e){return this.pipe(e)}unpipe(e){this.off("data",r=>{if(e instanceof a)e._write(r);else {let t=e.getWriter();t.write(r).then(()=>t.releaseLock());}}),this.off("end",()=>{e instanceof a?e._end():e.getWriter().close();}),this.off("error",r=>{e instanceof a?e._error(r):e.getWriter().abort(r);});}destroy(e){this.reader.cancel(e).then(()=>{this._emit("close");}).catch(r=>{this._emit("error",r);});}pause(){this.paused=true,this._emit("pause");}resume(){this.paused&&(this.paused=false,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null));}get isPaused(){return this.paused}async read(){this.paused&&await new Promise(t=>{this.resumeCallback=t;});let{done:e,value:r}=await this.reader.read();if(!e)return r}setEncoding(e){this.encoding=e;}async text(){let e=[];for(;;){let{done:t,value:i}=await this.reader.read();if(t)break;i&&e.push(i);}return new TextDecoder(this.encoding||"utf-8").decode(await new Blob(e).arrayBuffer())}async json(){let e=await this.text();return JSON.parse(e)}_write(e){this._emit("data",e);}_end(){this._emit("end");}_error(e){this._emit("error",e);}_emit(e,r){if(this.events[e])for(let t of this.events[e]||[])t(r);}async _startReading(){try{for(this._emit("readable");;){this.paused&&await new Promise(t=>{this.resumeCallback=t;});let{done:e,value:r}=await this.reader.read();if(e){this._emit("end"),this._emit("close");break}r&&this._emit("data",r);}}catch(e){this._emit("error",e);}}[Symbol.asyncIterator](){return {next:async()=>{this.paused&&await new Promise(t=>{this.resumeCallback=t;});let{done:e,value:r}=await this.reader.read();return e?{done:true,value:void 0}:{done:false,value:r}},[Symbol.asyncIterator](){return this}}}};export{s as UndiciStreamWrapper};
|