Skip to content

Commit

Permalink
[OPIK-558] Typescript SDK - basic client (#919)
Browse files Browse the repository at this point in the history
* Initial setup for the TypeScript SDK

* Add tsup/vitest configs

* Change code generation to have the original output instead of a compiled one (ESM vs CJS)

* WIP: Adding test suite

* Fix first unit tes

* WIP: Add classes instead of functions

* First draft of client, trace and span classes

* Improve types

* Improve defaults

* Add support for CJS

* Add global headers to the configuration (comet-workspace / authorization)

* Add support for custom environment, workspace and project names

* Improve project name management

* Increment patch version

* Improve metadata in the package.json

* Sync with main
  • Loading branch information
ferc authored Jan 2, 2025
1 parent 30d7f45 commit 611adce
Show file tree
Hide file tree
Showing 14 changed files with 4,663 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/opik-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "opik",
"name": "opik-frontend",
"description": "This is Front End part of Comet Opik",
"version": "0.0.1",
"private": true,
Expand Down
2 changes: 2 additions & 0 deletions sdks/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
16 changes: 16 additions & 0 deletions sdks/typescript/examples/manual-trace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Opik } from "opik";

const client = new Opik();
const someTrace = await client.trace({
name: "test123",
startTime: new Date(),
});

const someSpan = await someTrace.span({
name: "test123 span",
type: "llm",
startTime: new Date(),
});

await someSpan.end();
await someTrace.end();
Loading

0 comments on commit 611adce

Please sign in to comment.