-
I am using AutoGen to implement a multi-agent system for my inventory management task. The system integrates Python code for managing inventory databases. However, I am encountering an issue where the agents fail to execute code as expected. I tried with function calling and tools but there are no changes. I am not getting the expected output.
I tried with different prompt and tried with Llama 3.2 1B model but there are no changes. Thanking you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Our current stable version is v0.4.3, you are not using a Microsoft-published package. Please install Also, your code is using v0.2 API, please see the migration guide for v0.4: https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/migration-guide.html For your example, I tried with llama3.2 2B using Ollama: import asyncio
from typing import Dict, List
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
def inventry_check() -> List[Dict]:
"""Get item, unit and unit price from the inventory database."""
result = [
(1, "Apple", 5, 10),
(2, "Banana", 15, 5),
(3, "Orange", 7, 8),
(4, "Pineapple", 20, 15),
(5, "Mango", 10, 20),
]
items = [{"Item": row[1], "Quantity": row[2], "Unit price": row[3]} for row in result]
return items
async def main() -> None:
model_client = OpenAIChatCompletionClient(
model="llama3.2:latest",
base_url="http://localhost:11434/v1",
api_key="placeholder",
model_info={
"vision": False,
"function_calling": True,
"json_output": False,
"family": "unknown",
},
)
agent = AssistantAgent(
"assistant",
model_client=model_client,
tools=[inventry_check],
reflect_on_tool_use=True,
)
stream = agent.run_stream(task="How many apples are in the inventory?")
await Console(stream)
asyncio.run(main()) Output:
|
Beta Was this translation helpful? Give feedback.
Our current stable version is v0.4.3, you are not using a Microsoft-published package. Please install
autogen-agentchat
.Also, your code is using v0.2 API, please see the migration guide for v0.4: https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/migration-guide.html
For your example, I tried with llama3.2 2B using Ollama: