aws-samples / aws-samples/aws-iot-twinmaker-samples
fix: migrate llm.py from langchain.llms.bedrock to langchain_aws
- Dominant language
- TypeScript
- Stars
- 116
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
## 概要
langchain v0.2 の破壊的変更により `langchain.llms.bedrock` が削除されました。
`llm.py` の Bedrock 統合を `langchain_aws` に移行する必要があります。
## 変更内容
- `from langchain.llms.bedrock import Bedrock` → `from langchain_aws.llms import BedrockLLM`(または ChatBedrock)
- `from langchain.embeddings.bedrock import BedrockEmbeddings` → `from langchain_aws import BedrockEmbeddings`
- モデルID: `anthropic.claude-instant-v1` / `anthropic.claude-v2` → claude-3 系への更新検討(Anthropic legacy models decommission 対応)
## 背景
PR #164 (`feat/assistant-chainlit2-langchain2`) で chainlit 2.x / langchain-classic 移行を完了。
`llm.py` の Bedrock 統合は今回スコープ外としてホールド。
## 対象ファイル
- `src/workspaces/cookiefactoryv3/assistant/app/lib/llm.py`
## 参考
- [langchain-aws migration guide](https://python.langchain.com/docs/integrations/platforms/aws/)
- langchain v0.2 breaking changes: `langchain.llms` removed
Contributor guide
Research direction
Start with src/workspaces/cookiefactoryv3/assistant/app/lib/llm.py and review the langchain-aws migration guide linked in the issue. Check how the current Bedrock model and embedding integrations are used, then validate the migration with the project's existing checks. Done means the imports work with the migrated dependencies and the Bedrock integrations use supported model choices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100