Skip to content

chore: add ANTHROPIC_API_KEY to langchain example .env.example - #40

Draft
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1786957681-langchain-anthropic-env
Draft

chore: add ANTHROPIC_API_KEY to langchain example .env.example#40
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1786957681-langchain-anthropic-env

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

The LangChain example advertises Anthropic support (README: "supporting multiple providers including OpenAI, Anthropic, Google GenAI, and AWS Bedrock") and ships langchain-anthropic as a dependency since #34, but .env.example never listed the key that provider needs, so anyone pointing an AI Config at an Anthropic model gets an auth error with no hint from the example config.

 OPENAI_API_KEY=
+ANTHROPIC_API_KEY=
 GOOGLE_API_KEY=

No dependency changes needed

Every manifest uses floor/caret constraints and poetry.lock is gitignored, so poetry install already resolves to the latest within-major releases; per repo hygiene, already-satisfied constraints are not bumped. Resolved today in the LangChain example env:

launchdarkly-server-sdk-ai 1.2.0 (latest), launchdarkly-server-sdk-ai-langchain 0.8.0 (latest), launchdarkly-server-sdk-ai-openai 0.7.0 (latest), launchdarkly-observability 1.3.2 (latest), launchdarkly-server-sdk 9.16.1, langchain 1.3.15, langgraph 1.2.11, openai 3.1.0, boto3 1.43.72.

google-genai stays at ^1.30.0 (latest is 2.18.1 — a major jump). The launchdarkly-server-sdk-ai = ">=0.20.0" floors in the getting_started examples are left alone: 0.20.0 already exposes every API these examples use (completion_config, AICompletionConfigDefault, track_metrics_of_async, summary.tokens), so the declared minimum is not wrong, and the constraint installs 1.2.0 anyway.

How it was validated

  • poetry install in all 10 example directories (the repo's only CI check) — all succeed against today's latest published deps.
  • Imported every example module with DeprecationWarnings enabled: no deprecated LaunchDarkly API usage. (The OpenAI example constructs OpenAI() at import time, so it needs OPENAI_API_KEY; unrelated to this change.)
  • Ran the LangChain example path end-to-end against a real LaunchDarkly SDK key with an Anthropic model, using only ANTHROPIC_API_KEY from the environment — this is exactly the path the new env var documents:
init True
enabled True claude-sonnet-4-5 anthropic
response: I can help you with a wide variety of tasks, including: ...
duration 5763 success True tokens (20, 236, 256)

Limitations

  • The example config keys (sample-completion, sample-agent, ...) do not exist in the available LaunchDarkly project, so completion_config returns a disabled config; the end-to-end run above supplied an AICompletionConfigDefault locally instead. The other providers (OpenAI, Gemini, Bedrock) could not be exercised — no provider credentials available here.
  • Pre-existing and not fixable in this repo: launchdarkly-observability's generated GraphQL client imports the deprecated websockets.client / websockets.legacy API, emitting DeprecationWarning on import of every example. That belongs to the observability SDK.
  • The stale AIConfig reference in the commented resiliency defaults is already handled by open PR chore: correct commented default class name to AICompletionConfigDefault #38; not duplicated here.

Link to Devin session: https://app.devin.ai/sessions/6616c6d9b1164addb8900bde78197a14

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot added the devin-pr PR created by Devin label Aug 17, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@cursor review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr PR created by Devin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants