-
Notifications
You must be signed in to change notification settings - Fork 497
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
Hierarchical Agent Teams with Ollama #196
Comments
Would happily review a PR of a notebook that reliably implements this with OSS models! My laptop crashes anytime I try to run anything > 1B parameters in size |
I am trying to modify |
The approach that proved effective for me, which you might consider, involves removing the elements from the message placeholder. The reason behind this is that when you input them as a message placeholder, the system interprets them as a string. However, our requirement is for a list format.
|
The same issue happens when replacing OpenAI with antropic. I'm at a loss because I ran out of OpenAI allowed use and none of the multi-agent notebooks work for me with anthropic models. The error message is slightly different: You can check this repo for the exact code I'm using: https://github.com/ChristianSch/agents/blob/main/multi-agent/agent_supervisor.py @shashankbist37 's recommendation to move everything to simple format placeholders did not work out for me. |
You can likely replace the system messages with user messages |
Pushed some updates but will do some more checks when i find time |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
The output is copied directly from LangSmith, the stacktrace is truncated both in console and LangSmith.
ValueError('variable agent_scratchpad should be a list of base messages, got ')Traceback (most recent call last):
File ".../langchain_core/runnables/base.py", line 1262, in _call_with_config
context.run(
File ".../langchain_core/runnables/config.py", line 326, in call_func_with_variable_args
return func(input, **kwargs) # type: ignore[call-arg]
^^^^^^^^^^^^^^^^^^^^^
File ".../langchain_core/prompts/base.py", line 103, in _format_prompt_with_error_handling
return self.format_prompt(**inner_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../langchain_core/prompts/chat.py", line 535, in format_prompt
messages = self.format_messages(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../langchain_core/prompts/chat.py", line 797, in format_messages
message = message_template.format_messages(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../langchain_core/prompts/chat.py", line 129, in format_messages
raise ValueError(
ValueError: variable agent_scratchpad should be a list of base messages, got
Description
I'm trying to reproduce the provided example hierarchical_agent_teams.ipynb using Ollama with
OllamaFunctions
I solved some incompatibility issues found with the
bind_function
replaced withbind
and passing explicitly the "name" of theroute
function ({"name": "route"}
instead of"route"
).After that, I'm stuck on this error:
'variable agent_scratchpad should be a list of base messages, got
. The output seems to be truncated but this happens because theagent_scratchpad
variable is empty (''
).How this can be solved? Am I making some error in the GraphState or something else?
Thanks in advance for the support.
System Info
$ python -m langchain_core.sys_info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
The text was updated successfully, but these errors were encountered: