Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPIK-558] Typescript SDK - basic client #919

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Conversation

ferc
Copy link
Collaborator

@ferc ferc commented Dec 18, 2024

Details

  • Added initial setup for the TS/JS SDK
  • Basic Opik client, being able to customize API key, host and project name
  • Basic classes to log traces/spans manually
  • Edited Fern generation to have better support for different JS module exports (CJS/ESM) and support different JS runtimes (Node, Deno, Bun)
    • Added custom override for openapi.yaml to add global headers (Authorization / Comet-Workspace) to the global Fern config (affected current Python SDK generated files, if it's not good for it I can split into different fern configurations, fern does not support custom overrides for each group)

Issues

Resolves #

Testing

Documentation

@ferc ferc requested a review from a team as a code owner December 18, 2024 12:05
Copy link
Collaborator

@andrescrz andrescrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been focus on the auto-generation set up in this review. My only question is about the .gitignore file.

I recommend splitting this PR in two:

  1. Just all the Fern set up and changes in the auto-generated classes.
  2. Then all your typescript custom code for the SDK, including examples etc.

Reasons:

  1. You get a proper review on the SDK code, which is the actual valuable thing. Now it's lost in the middle of all the auto-generated changes.
  2. We're following the convention of pushing auto-generated code in isolation. Among other reasons, you're code can be stale. It's actually, due to some latest changes in the backend.

}
"organization": "Opik",
"version": "0.45.3"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very picky and minor: keep the extra end of line.

"version": "0.45.0"
}
"organization": "Opik",
"version": "0.45.3"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: if you're going to update the Fern version, I'd go with the last one, which is 0.46.5

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I updated it weeks ago when I had to due a bugfix that Fern has and now they released a more updated version so agree, I'll keep it updated to the latest one, thanks for noticing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to maintain just the .gitignore file in the root folder of the repo.

@ferc
Copy link
Collaborator Author

ferc commented Dec 18, 2024

@andrescrz this is a first draft to have a first iteration of the TS SDK, it's not final, it's something that'll be changed in next iterations so no point to review the API in the SDK yet

I'll split the PRs as suggested but I don't think we should hold the TS SDK changes too long, again, we'll iterate in the actual API soon, now we need a first iteration of a build and publish an alpha version in NPM, that counts about the "examples" you are asking, it's not needed right now since we'll change a lot of things, when it's stable, we'll add more proper examples than the one it's now

FYI, the code is not outdated, I ran the fern generate on every sync with master so it's up to date

In any case, we can merge on my way back, thanks for the feedback

@jverre jverre mentioned this pull request Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants