Commit 667b4b7
chore: update LaunchDarkly AI SDK and langchain dependencies to latest versions (#20)
## Summary
Updates LaunchDarkly AI SDK dependencies and the langchain ecosystem to
their latest versions. The `ldai_langchain` 0.4.0 release removed the
`LangChainProvider` class in favor of top-level helper functions, so the
three langchain-based examples are updated accordingly.
**Dependency changes in `pyproject.toml`:**
| Package | Old | New |
|---|---|---|
| `launchdarkly-server-sdk-ai` | ^0.16.1 | ^0.17.0 |
| `launchdarkly-server-sdk-ai-langchain` | ^0.3.2 | ^0.4.0 |
| `launchdarkly-server-sdk-ai-openai` | ^0.2.1 | ^0.3.0 |
| `langchain` | ^0.3.0 | ^1.0.0 |
| `langchain-core` | ^0.3.0 | ^1.0.0 |
| `langchain-aws` | ^0.2.30 | ^1.0.0 |
| `langchain-openai` | ^0.3.30 | ^1.0.0 |
| `langchain-google-genai` | ^2.1.9 | ^4.0.0 |
| `langgraph` | ^0.2.0 | ^1.0.0 |
**Code changes:** `LangChainProvider.get_ai_metrics_from_response` →
`get_ai_metrics_from_response` (now a top-level import from
`ldai_langchain`) in `langchain_example.py`,
`langgraph_agent_example.py`, and `langgraph_multi_agent_example.py`.
## Review & Testing Checklist for Human
- [ ] Verify the langchain 0.x → 1.x migration doesn't break other APIs
used in the examples (e.g., `init_chat_model`, message dict format,
`ainvoke`). Only the `LangChainProvider` import was updated — other
langchain usage was left as-is.
- [ ] Confirm `langchain-google-genai` ^4.0.0 is correct — this skips
the 3.x line. Check that the `gemini_example.py` still works with this
version.
- [ ] Verify `poetry.lock` is either committed or intentionally
gitignored. It is not included in this diff.
- [ ] Run at least one example end-to-end (e.g., `poetry run
openai-example` or `poetry run langchain-example`) to confirm the
updated SDKs work with a real LaunchDarkly AI config.
### Notes
- The non-langchain examples (`openai_example.py`, `bedrock_example.py`,
`gemini_example.py`, `chat_judge_example.py`,
`chat_observability_example.py`, `direct_judge_example.py`) were not
modified. Their imports were verified to still resolve, but they were
not tested end-to-end.
- The langchain ecosystem bump from 0.x to 1.x was required because
`ldai_langchain` 0.4.0 itself depends on `langchain >=1.0.0`.
Link to Devin session:
https://app.devin.ai/sessions/c8cf47d46e3f464290a65b6c05862c86
Requested by: @kinyoklion
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent ce84fe5 commit 667b4b7
4 files changed
Lines changed: 15 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments