streamEvents
call for agent created with model ChatDeepInfra throws error: "Cannot read properties of undefined (reading 'message')"
#7638
Labels
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
const llm = new ChatDeepInfra({
model: "deepseek-ai/DeepSeek-R1",
apiKey: process.env.DEEPINFRA_API_TOKEN,
temperature: 0.7,
});
const stream = agent.streamEvents(
{
messages: [new HumanMessage("Hello")],
},
{ version: "v2" },
);
Error Message and Stack Trace (if applicable)
2025-02-02 12:45:18 TypeError: Cannot read properties of undefined (reading 'message')
2025-02-02 12:45:18 at ChatDeepInfra.invoke (/usr/src/app/node_modules/@langchain/core/dist/language_models/chat_models.cjs:71:31)
2025-02-02 12:45:18 at processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-02-02 12:45:18 at RunnableSequence.invoke (/usr/src/app/node_modules/@langchain/core/dist/runnables/base.cjs:1291:27)
2025-02-02 12:45:18 at RunnableCallable.callModel [as func] (/usr/src/app/node_modules/@langchain/langgraph/dist/prebuilt/react_agent_executor.cjs:175:29)
2025-02-02 12:45:18 at RunnableCallable.invoke (/usr/src/app/node_modules/@langchain/langgraph/dist/utils.cjs:82:27)
2025-02-02 12:45:18 at RunnableSequence.invoke (/usr/src/app/node_modules/@langchain/core/dist/runnables/base.cjs:1285:33)
2025-02-02 12:45:18 at _runWithRetry (/usr/src/app/node_modules/@langchain/langgraph/dist/pregel/retry.cjs:70:22)
2025-02-02 12:45:18 at PregelRunner._executeTasksWithRetry (/usr/src/app/node_modules/@langchain/langgraph/dist/pregel/runner.cjs:211:33)
2025-02-02 12:45:18 at PregelRunner.tick (/usr/src/app/node_modules/@langchain/langgraph/dist/pregel/runner.cjs:48:40)
2025-02-02 12:45:18 at CompiledStateGraph._runLoop (/usr/src/app/node_modules/@langchain/langgraph/dist/pregel/index.cjs:1018:17)
2025-02-02 12:45:18 at createAndRunLoop (/usr/src/app/node_modules/@langchain/langgraph/dist/pregel/index.cjs:907:17) {
2025-02-02 12:45:18 pregelTaskId: '84d27050-8f24-5b8b-9b7b-cbf31ac60197'
2025-02-02 12:45:18 }
Description
I am trying to call
streamEvents
on a react agent created with llmChatDeepInfra
(deepseek-ai/DeepSeek-R1). The code works fine when I use another llm (ChatOpenAI) so I am guessing it is specific for this case. Also, it works if I invokestreamEvents
directly on the model without creating an agent. Any feedback would be much appreciated. Thank you in advance.System Info
|
-- @langchain/[email protected] deduped +-- @langchain/[email protected] | +-- @langchain/[email protected] deduped | +-- @langchain/[email protected] deduped |
-- [email protected] deduped+-- @langchain/[email protected]
+-- @langchain/[email protected]
| +-- @langchain/[email protected] deduped
|
-- @langchain/[email protected] |
-- @langchain/[email protected] deduped+-- @langchain/[email protected]
|
-- @langchain/[email protected] deduped +-- @langchain/[email protected]
-- [email protected]+-- @langchain/[email protected] deduped
+-- @langchain/[email protected] deduped
+-- @langchain/[email protected] deduped
-- @langchain/[email protected]
-- @langchain/[email protected] dedupedThe text was updated successfully, but these errors were encountered: