I was testning a multi-agent workflows but unfortunately i was running to an issue
llama_index.core.workflow.errors.WorkflowRuntimeError: Error in step 'run_agent_step': Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_yLipsAco1KnF3jvwLCsUZQKc", 'type': 'invalid_request_error', 'param': 'messages.[4].role', 'code': None}}
code is as below.
embed_agent = FunctionAgent(
name="embeddings creator",
description="Performs embeddings creation task",
system_prompt="You are a assistant to create embeddings for the given data",
tools=[
FunctionTool.from_defaults(fn=create_embeddings),
],
llm=llm,
can_handoff_to=["data ingestor"]
)
ingest_agent = FunctionAgent(
name="data ingestor",
description="Performs data ingestion task",
system_prompt="You are a assistant to ingest data / embeddings into vector database",
tools=[
FunctionTool.from_defaults(fn=ingest_to_vec_db),
],
llm=llm
)
trigger:
async def main():
# Create and run the workflow
workflow = AgentWorkflow(
agents=[embed_agent, ingest_agent], root_agent="embeddings creator"
)
await workflow.run(user_msg="embed the data and ingest it to vector database")
if __name__ == "__main__":
import asyncio
asyncio.run(main())
we hve the functions defined and using the LLM that has function calling capability. can some one please help me understand this.