tool_call_id_validationTier 1 · 70% confidence
ai-agents-tool-call-id-validat-when-using-create-tool-calling-agent-with-an-input-770eceae
agent: ai_agents
When does this happen?
IF When using create_tool_calling_agent with an InputChat model that includes ToolMessage in the Union type for chat_history, and the chat history contains messages without 'tool_call_id' (e.g., HumanMessage), a KeyError occurs during pydantic validation.
How others solved it
THEN Either remove the specific type hints from the chat_history field (use `List` without Union) or apply a custom validator. The root cause is in the ToolMessage validator expecting 'tool_call_id' unconditionally; a fix is to change `values["tool_call_id"]` to `values.get("tool_call_id")` in langchain_core/messages/tool.py. Updating the library is also recommended.
class InputChat(BaseModel):
chat_history: List = Field(..., description="The chat messages.")
input: strRelated patterns
model_loading
ai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
anthropic_api_deprecationai-agents-anthropic-api-deprec-using-chatanthropic-from-langchain-community-with--be5e430f
Tier 1 · 70%
tool_handlingai-agents-tool-handling-repeated-identical-tool-function-names-in-consecut-18263441
Tier 1 · 70%
tool_calling_conflictai-agents-tool-calling-conflic-when-using-bedrock-models-with-both-structured-out-6184f1e9
Tier 1 · 70%
ollama_chunk_parsingai-agents-ollama-chunk-parsing-ollama-model-returns-thinking-field-in-streaming-c-0624da72
Tier 1 · 70%
sequential_thinking_decompositionai-agents-sequential-thinking--complex-problem-requires-detailed-step-by-step-rea-926100d1
Tier 1 · 70%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.