-
Notifications
You must be signed in to change notification settings - Fork 16.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
langchain-ollama (partners): allow passing ChatMessage (with custom 'role') to ChatOllama #30191
base: master
Are you sure you want to change the base?
langchain-ollama (partners): allow passing ChatMessage (with custom 'role') to ChatOllama #30191
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
from my initial stack trace in 30122, I'm afraid that I will not be able to use create_react_agent to work with granite3.2 |
@lemassykoi you will have to explicitly use a ChatMessage instance for the "control/thinking" message like so:
Or, for example with more context:
For now, I'd recommend using a ChatMessage instance as described above. I'm looking into whether we can have it accept a dictionary message like this:
|
…hat' type if 'type' arg is not provided
In order to make this also work with @ccurme my suggestion would be to merge this PR, which allows using ChatMessage with custom 'role' attributes with ChatOllama and closes #30122. And I can open a separate discussion and/or issue regarding how to handle 'role' vs 'type' keys in |
**Description: currently, ChatOllama will raise a value error if a ChatMessage is passed to it, as described here. This PR enables passing a langchain ChatMessage with a custom 'role' attribute through the langchain ChatOllama class.
Issue: resolves #30122 (also related to PR #30147 and ollama-python issue ollama/ollama#8955)
Dependencies: no new dependencies