From d979955c8a82e15e7070c937fb7e0ce6ac72ffda Mon Sep 17 00:00:00 2001 From: John Wang Date: Thu, 27 Jul 2023 22:15:07 +0800 Subject: [PATCH] feat: optimize current time (#661) --- api/core/completion.py | 4 ++-- api/core/orchestrator_rule_parser.py | 3 ++- api/libs/helper.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/core/completion.py b/api/core/completion.py index 8c1e423819..755f376c25 100644 --- a/api/core/completion.py +++ b/api/core/completion.py @@ -27,13 +27,13 @@ from core.orchestrator_rule_parser import OrchestratorRuleParser from core.prompt.prompt_builder import PromptBuilder from core.prompt.prompt_template import JinjaPromptTemplate from core.prompt.prompts import MORE_LIKE_THIS_GENERATE_PROMPT -from models.model import App, AppModelConfig, Account, Conversation, Message +from models.model import App, AppModelConfig, Account, Conversation, Message, EndUser class Completion: @classmethod def generate(cls, task_id: str, app: App, app_model_config: AppModelConfig, query: str, inputs: dict, - user: Account, conversation: Optional[Conversation], streaming: bool, is_override: bool = False): + user: Union[Account, EndUser], conversation: Optional[Conversation], streaming: bool, is_override: bool = False): """ errors: ProviderTokenNotInitError """ diff --git a/api/core/orchestrator_rule_parser.py b/api/core/orchestrator_rule_parser.py index 7890544f97..38361f65c5 100644 --- a/api/core/orchestrator_rule_parser.py +++ b/api/core/orchestrator_rule_parser.py @@ -250,7 +250,8 @@ class OrchestratorRuleParser: def to_current_datetime_tool(self) -> Optional[BaseTool]: tool = Tool( name="current_datetime", - description="A tool when you want to get the current date or time. ", + description="A tool when you want to get the current date, time, week, month or year, " + "and the time zone is UTC. Result is \"