Skip to content

Commit

Permalink
fix:core agent dependent prompt service bug (#2129)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-ckt authored Nov 18, 2024
1 parent 2decf02 commit b392d51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dbgpt/agent/core/plan/awel/agent_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

# TODO: Don't dependent on MixinLLMOperator
from dbgpt.model.operators.llm_operator import MixinLLMOperator
from dbgpt.serve.prompt.api.endpoints import get_service
from dbgpt.util.i18n_utils import _

from .... import ActionOutput
Expand Down Expand Up @@ -291,6 +290,7 @@ async def get_agent(

prompt_template = None
if self.awel_agent.agent_prompt:
from dbgpt.serve.prompt.api.endpoints import get_service
prompt_service = get_service()
prompt_template = prompt_service.get_template(
self.awel_agent.agent_prompt.code
Expand Down
3 changes: 1 addition & 2 deletions dbgpt/agent/core/plan/awel/agent_operator_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
ResourceCategory,
register_resource,
)
from dbgpt.serve.prompt.api.endpoints import get_service

from ....resource.base import AgentResource, ResourceType
from ....resource.manage import get_resource_manager
from ....util.llm.llm import LLMConfig, LLMStrategyType
from ...agent_manage import get_agent_manager


def _agent_resource_prompt_values() -> List[OptionValue]:
from dbgpt.serve.prompt.api.endpoints import get_service
prompt_service = get_service()
prompts = prompt_service.get_target_prompt()
return [
Expand Down

0 comments on commit b392d51

Please sign in to comment.