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

Use openai wrapper #52

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Use openai wrapper #52

merged 3 commits into from
Jan 23, 2024

Conversation

ankrgyl
Copy link
Contributor

@ankrgyl ankrgyl commented Jan 23, 2024

This accompanies braintrustdata/braintrust-sdk#92 and uses the built-in openai wrappers.

@ankrgyl ankrgyl requested a review from manugoyal January 23, 2024 04:10
@ankrgyl ankrgyl requested a review from edenh January 23, 2024 04:17
@@ -50,4 +50,4 @@ test("Embeddings Test", async () => {
expect(result.score).toBeLessThan(0.5);
}
}
});
}, 600000);
Copy link
Contributor

Choose a reason for hiding this comment

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

10 minutes seems like a pretty long timeout for a unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the same as others -- it is just when the openai cache misses

export async function cachedChatCompletion(
params: CachedLLMParams,
options: { cache?: ChatCache } & OpenAIAuth
): Promise<ChatCompletion> {
const { cache } = options;

return await currentSpanTraced(
Copy link
Contributor

Choose a reason for hiding this comment

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

nice! Can we delete this now from utils.ts?

@ankrgyl ankrgyl merged commit a9eca06 into main Jan 23, 2024
7 checks passed
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