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 searched existing ideas and did not find a similar one
I added a very descriptive title
I've clearly described the feature request and motivation for it
Feature request
So far, ChatOllama doesn't accept if a tool responds non-string content:
error: "Non string tool message content is not supported\n\nError: Non string tool message content is not supported\n at convertToolMessageToOllama (file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/ollama/dist/utils.js:119:15)\n at file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/ollama/dist/utils.js:140:20\n at Array.flatMap (<anonymous>)\n at convertToOllamaMessages (file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/ollama/dist/utils.js:129:21)\n at ChatOllama._streamResponseChunks (file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/ollama/dist/chat_models.js:730:32)\n at _streamResponseChunks.next (<anonymous>)\n at ChatOllama._generateUncached (file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/core/dist/language_models/chat_models.js:211:34)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async ChatOllama.invoke (file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/core/dist/language_models/chat_models.js:88:24)\n at async RunnableSequence.invoke (file:///Users/ryosuke.iwanaga/.npm/_npx/25982cb890102a2e/node_modules/aethr/node_modules/@langchain/core/dist/runnables/base.js:1280:27)"
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
-
Checked
Feature request
So far,
ChatOllama
doesn't accept if a tool responds non-string content:However, Python version handle this case without exception: https://github.com/langchain-ai/langchain/blob/e9e597be8e3b75f3659401d38ddef893d9861ceb/libs/partners/ollama/langchain_ollama/chat_models.py#L542-L582
How about to align the implementation with Python? Or at least just
JSON.stringify()
for now likeChatOpenAI
does?langchainjs/libs/langchain-openai/src/chat_models.ts
Lines 503 to 506 in b7a9cac
Motivation
This is annoying because some of the models accept the non-string content but some don't. Here is DeepWiki's investigation: https://deepwiki.com/search/relevantcontextthis-query-was_e0a9a7d2-be3b-458c-a716-0d4842a54053
Proposal (If applicable)
First, just
JSON.stringify()
like OpenAI.Then, port Python's implementation.
ref. autifyhq/aethr#15
Beta Was this translation helpful? Give feedback.
All reactions