You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a very descriptive title to this question.
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
Commit to Help
I commit to help with one of those options 👆
Example Code
# Passing the following model to `create_react_agent` with tools does# not work because `GenericFakeChatModel` has no bind_tools# and also does not handle the `tool_calls`in `AIMessage`.fromlangchain_core.language_modelsimportGenericFakeChatModel, LanguageModelInputGenericFakeChatModel(
messages=iter([
AIMessage(content="42"),
AIMessage(
content="I want to call a tool",
tool_calls=[
ToolCall(
id="tool_call_1",
name="HelloTool",
args={"name": "World"},
)
],
),
])
)
Description
I want to test my agent using the predefined FakeChatModels (GenericFakeChatModel)
My questions: Is there another FakeChatModel I can use for such tests? Should GenericFakeChatModel be extended to also handle Tools? How could you extend GenericFakeChatModel? (I'm open to contributing)
System Info
System Information
OS: Darwin
OS Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
Python Version: 3.13.5 (main, Jun 11 2025, 15:36:57) [Clang 17.0.0 (clang-1700.0.13.3)]
aiohttp: 3.11.18
anthropic[vertexai]: Installed. No version info available.
azure-ai-inference[opentelemetry]: Installed. No version info available.
azure-core: 1.34.0
azure-cosmos: 4.9.0
azure-identity: 1.22.0
azure-monitor-opentelemetry: Installed. No version info available.
bottleneck: 1.5.0
google-cloud-aiplatform: 1.93.1
google-cloud-storage: 2.19.0
httpx: 0.28.1
httpx-sse: 0.4.0
jsonpatch<2.0,>=1.33: Installed. No version info available.
langchain-core<0.4,>=0.3.36: Installed. No version info available.
langchain-core<1.0.0,>=0.3.59: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langsmith-pyo3: Installed. No version info available.
langsmith<0.4,>=0.1.126: Installed. No version info available.
mcp>=1.9.1: Installed. No version info available.
numexpr: 2.10.2
numpy: 2.2.5
openai-agents: Installed. No version info available.
openai<2.0.0,>=1.68.2: Installed. No version info available.
opentelemetry-api: 1.31.1
opentelemetry-exporter-otlp-proto-http: 1.31.1
opentelemetry-instrumentation-threading: 0.52b1
opentelemetry-sdk: 1.31.1
opentelemetry-semantic-conventions-ai: 0.4.8
orjson: 3.10.18
packaging: 24.2
packaging<25,>=23.2: Installed. No version info available.
pyarrow: 19.0.1
pydantic: 2.11.4
pydantic>=2.7.4: Installed. No version info available.
pytest: 8.3.5
PyYAML>=5.3: Installed. No version info available.
requests: 2.32.3
requests-toolbelt: 1.0.0
rich: 14.0.0
tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available.
tiktoken<1,>=0.7: Installed. No version info available.
typing-extensions>=4.7: Installed. No version info available.
validators: 0.35.0
zstandard: 0.23.0
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
My questions: Is there another FakeChatModel I can use for such tests? Should GenericFakeChatModel be extended to also handle Tools? How could you extend GenericFakeChatModel? (I'm open to contributing)
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
Beta Was this translation helpful? Give feedback.
All reactions