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

[Bug] [ModuleNotFoundError] No module named 'dbgpt.serve' v0.6.1 #2097

Open
2 of 15 tasks
Appointat opened this issue Oct 24, 2024 · 1 comment
Open
2 of 15 tasks

[Bug] [ModuleNotFoundError] No module named 'dbgpt.serve' v0.6.1 #2097

Appointat opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working Waiting for reply

Comments

@Appointat
Copy link
Contributor

Appointat commented Oct 24, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

MacOS(x86)

Python version information

3.10

DB-GPT version

latest release (v0.6.1)

Related scenes

  • Chat Data
  • Chat Excel
  • Chat DB
  • Chat Knowledge
  • Model Management
  • Dashboard
  • Plugins

Installation Information

Device information

MacOS M2
pip install dbgpt
(version is v0.6.1)

Models information

gpt-4o, want to use tool calling.

What happened

me % python dual_agent.py

Traceback (most recent call last):
File "/dual_agent.py", line 4, in
from dbgpt.agent import AgentContext, AgentMemory, LLMConfig, UserProxyAgent
File "/Applications/miniconda3/envs/_env/lib/python3.10/site-packages/dbgpt/agent/init.py", line 18, in
from .core.plan import * # noqa: F401, F403
File "/Applications/miniconda3/envs/
_env/lib/python3.10/site-packages/dbgpt/agent/core/plan/init.py", line 3, in
from .awel.agent_operator import ( # noqa: F401
File "/Applications/miniconda3/envs/*****_env/lib/python3.10/site-packages/dbgpt/agent/core/plan/awel/agent_operator.py", line 25, in
from dbgpt.serve.prompt.api.endpoints import get_service
ModuleNotFoundError: No module named 'dbgpt.serve'

What you expected to happen

...

How to reproduce

import asyncio
import os

from dbgpt.agent import AgentContext, AgentMemory, LLMConfig, UserProxyAgent
from dbgpt.agent.expand.tool_assistant_agent import ToolAssistantAgent
from dbgpt.agent.resource import ToolPack, tool
from dbgpt.model.proxy.llms.chatgpt import OpenAILLMClient
from pydantic import BaseModel, Field


class ArgsSchema(BaseModel):
    a: int = Field(description="The first number.")
    b: int = Field(description="The second number.")


@tool(args_schema=ArgsSchema)
def two_sum(a: int, b: int) -> int:
    """Add two numbers and return the sum."""
    return a + b


tools = ToolPack([two_sum])


async def main():
    llm_client = OpenAILLMClient(
        model_alias="gpt-4o",
        api_base=os.getenv("OPENAI_API_BASE"),
        api_key=os.getenv("OPENAI_API_KEY"),
    )

    context: AgentContext = AgentContext(
        conv_id="test123", language="en", temperature=0.5, max_new_tokens=2048
    )
    agent_memory = AgentMemory()

    user_proxy = await UserProxyAgent().bind(agent_memory).bind(context).build()

    tool_man = (
        await ToolAssistantAgent()
        .bind(context)
        .bind(LLMConfig(llm_client=llm_client))
        .bind(agent_memory)
        .bind(tools)
        .build()
    )

    await user_proxy.initiate_chat(
        recipient=tool_man,
        reviewer=user_proxy,
        message="Calculate the product of 10 and 99",
    )

    await user_proxy.initiate_chat(
        recipient=tool_man,
        reviewer=user_proxy,
        message="Count the number of files in /tmp",
    )

    print("Done!")


if __name__ == "__main__":
    asyncio.run(main())

Additional context

No module named 'dbgpt.serve'

image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Appointat Appointat added bug Something isn't working Waiting for reply labels Oct 24, 2024
@Appointat Appointat changed the title [Bug] [ModuleNotFoundError] No module named 'dbgpt.serve' [Bug] [ModuleNotFoundError] No module named 'dbgpt.serve' v0.6.1 Oct 24, 2024
@Aries-ckt
Copy link
Collaborator

Aries-ckt commented Oct 24, 2024

it looks like from dbgpt.serve.prompt.api.endpoints import get_service problem. we will fix that soon.
/assign @yhjun1026 please take a look.
or downgrade your dbgpt sdk
try

pip install dbgpt==0.5.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply
Projects
None yet
Development

No branches or pull requests

2 participants