-
Notifications
You must be signed in to change notification settings - Fork 3
[Feature] Typescript Support for OpenAI, Anthropic and Langchain #9
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
Conversation
… (span is exported now, TODO: Trace and project type)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| import { generateTraceConfig } from "./traceConfig"; | ||
| import { getAttributesFromContext } from "../contextAttributes"; | ||
| // Removed unused imports that were causing linter errors | ||
| // import { INPUT_ATTRIBUTES, ... } from "./constants"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove these comments
|
|
||
| const CONTEXT_ATTRIBUTES_ATTRIBUTES_KEY = "attributes" as const; | ||
|
|
||
| export const ContextAttributes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review this one and methods like setValue, getValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are opentelemetry methods and standards, they are integral to tracing
| * Flag to check if the openai module has been patched | ||
| * Note: This is a fallback in case the module is made immutable (e.x. Deno, webpack, etc.) | ||
| */ | ||
| let _isOpenInferencePatched = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openinference
| const onError = (message: string) => (error: unknown) => { | ||
| diag.warn( | ||
| `OpenInference-LangChain: error processing langchain run, falling back to null. ${message}. ${error}`, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace openinference
Pull Request
Description
Describe the changes in this pull request:
pnpm installat ./typescript directorynpx ts-node path/to/script(recommended to usepnpm run build)Use script found in
Checklist
Related Issues
Closes #<issue_number>