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(anthropic): Do not check for apiKey existence when createClient parameters are present #6716

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

rxliuli
Copy link
Contributor

@rxliuli rxliuli commented Sep 7, 2024

Copy link

vercel bot commented Sep 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Sep 10, 2024 9:17pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Sep 10, 2024 9:17pm

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. auto:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Sep 7, 2024
@jacoblee93
Copy link
Collaborator

Thank you! Good catch, sorry for missing this.

@@ -949,7 +949,7 @@ export class ChatAnthropicMessages<
): Promise<Anthropic.Message> {
if (!this.batchClient) {
const options = this.apiUrl ? { baseURL: this.apiUrl } : undefined;
if (!this.apiKey) {
if (!this.apiKey && !this.createClient) {
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 this.createClient will always be defined since we have a default - can update

Copy link
Collaborator

Choose a reason for hiding this comment

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

Honestly, I don't really think we need a second check here. Will remove.

@jacoblee93 jacoblee93 merged commit 1e1d8d1 into langchain-ai:main Sep 10, 2024
37 checks passed
@langchain-ai langchain-ai locked as spam and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants