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
environment: os: windows 11, python: python3.12.7, agent framework: autogen0.4.7
hereafter is my code:
import os
import asyncio
from dotenv import load_dotenv
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import StdioServerParams, mcp_server_tools
from autogen_core.models import ModelFamily
load_dotenv()
async def main()->None:
sqlite_mcp_server=StdioServerParams(command='docker',
args=[
"run",
"--rm",
"-i",
"-v",
".:/mcp",
"mcp/sqlite",
"--db-path",
"/mcp/personal.db"
])
tools=await mcp_server_tools(sqlite_mcp_server)
# Create a model client.
model_client=OpenAIChatCompletionClient(
api_key=os.getenv('deepseek_API_Key'),
model=os.getenv('deepseek_model'),
base_url=os.getenv('deepseek_base_url'),
model_info={
"vision":False,
"function_calling":True,
"json_output":True,
"family":ModelFamily.UNKNOWN,
},
)
# Create an agent that can use tool.
agent=AssistantAgent(
name='sqlitedata',
model_client=model_client,
tools=tools,
reflect_on_tool_use=True,
)
# Start the agent .
result=await agent.run(task="Add a cloumn named 'job_title' and assign a random job title value to each guy in the personal_data.")
print(result.messages[-1].content)
if name=='main':
asyncio.run(main())
when I run this code, the result is 'TERMINATE', it shows that the code has been executed successful. but when I check the personal_data table, there is not column named 'job_title.' however, when I set the task='whose salary is lowest in the personal_data table', the code can give me a right answer.
The text was updated successfully, but these errors were encountered:
environment: os: windows 11, python: python3.12.7, agent framework: autogen0.4.7
hereafter is my code:
import os
import asyncio
from dotenv import load_dotenv
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import StdioServerParams, mcp_server_tools
from autogen_core.models import ModelFamily
load_dotenv()
async def main()->None:
if name=='main':
asyncio.run(main())
when I run this code, the result is 'TERMINATE', it shows that the code has been executed successful. but when I check the personal_data table, there is not column named 'job_title.' however, when I set the task='whose salary is lowest in the personal_data table', the code can give me a right answer.
The text was updated successfully, but these errors were encountered: