fix:core agent dependent prompt service bug (#2129)

This commit is contained in:
Aries-ckt 2024-11-18 09:46:18 +08:00 committed by GitHub
parent 2decf02c12
commit b392d51adf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -22,7 +22,6 @@ from dbgpt.core.interface.message import ModelMessageRoleType
# 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
@ -291,6 +290,7 @@ class AWELAgentOperator(
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

View File

@ -12,8 +12,6 @@ from dbgpt.core.awel.flow import (
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
@ -21,6 +19,7 @@ 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 [