Skip to content
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

SQLite mcp server: ALTER TABLE personal_data ADD COLUMN job_title TEXT doesn't add column to table. #729

Open
peter-chenqing opened this issue Mar 4, 2025 · 0 comments

Comments

@peter-chenqing
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant