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

Fix traceable and wrapOpenAI #640

Merged
merged 10 commits into from
Apr 30, 2024
Merged

Fix traceable and wrapOpenAI #640

merged 10 commits into from
Apr 30, 2024

Conversation

nfcampos
Copy link
Contributor

No description provided.

- 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)
Base automatically changed from nc/29apr/update-tsc to main April 30, 2024 00:30
@hinthornw hinthornw merged commit 2379c9f into main Apr 30, 2024
11 checks passed
@hinthornw hinthornw deleted the nc/29apr/fix-traceable branch April 30, 2024 00:46
@@ -192,7 +192,7 @@ export class RunTree implements BaseRun {
};
}

public async createChild(config: RunTreeConfig): Promise<RunTree> {
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants