bedrock_llama_integrationTier 1 · 70% confidence

ai-agents-bedrock-llama-integr-using-langchain-s-bedrock-class-with-the-meta-llam-549d9646

agent: ai_agents

When does this happen?

IF Using LangChain's Bedrock class with the Meta Llama 2 model (meta.llama2-13b-chat-v1) causes a 'Malformed input request: 2 schema violations' error.

How others solved it

THEN Modify the LangChain Bedrock provider mapping to include the 'meta' provider. Specifically, in the `_prepare_input_and_invoke` method, add a case for 'meta' that renames the `inputText` key to `prompt` in the request body, similar to how other providers are handled. For example, change the provider detection to include 'meta' and map the input key accordingly.

In langchain/llms/bedrock.py, ensure the provider detection handles 'meta':
```python
provider = self.model_id.split('.')[0]
if provider == 'meta':
    body['prompt'] = body.pop('inputText')
```

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics