-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix traceable and wrapOpenAI #640
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Switch out implementation for generating parallel CJS build - Follow guidelines from here microsoft/TypeScript#54567
- errors throw from sync and async functions should result in errored run - errors thrown by promise of async generator should result in errored run containing all output until then - interrupted promise of async generator should result in cancelled (errored) run containing all output until then - regular async generator (without promise wrapper) should be supported in success, error and interrupt cases
…e traceable doesn't modify return value of wrapped function - if function returns a subclass of promise return proxy object combining original return value and "traced" promise - if function returns async generator (without promise wrapper) do not wrap it in a promise - handle errors thrown in generator functions - handle errors thrown in sync functions - handle generator cancellations - handle errors thrown by tracing client
- Use custom return value methods on openai[.chat].completions.create() - Test that call-time metadata is attached to run
- also fix return type of patched openai sdk (it was missing lots of methods on the original)
hinthornw
approved these changes
Apr 30, 2024
bracesproul
reviewed
May 1, 2024
@@ -192,7 +192,7 @@ export class RunTree implements BaseRun { | |||
}; | |||
} | |||
|
|||
public async createChild(config: RunTreeConfig): Promise<RunTree> { |
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.
This is breaking. Need to revert this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.