From 9776bdda0d71bb4b507d6298920e29df353775d6 Mon Sep 17 00:00:00 2001 From: Marenz Date: Thu, 18 Jul 2024 17:53:47 +0200 Subject: [PATCH] Some type annotation additions Signed-off-by: Marenz --- blueprints/function_calling_blueprint.py | 5 +++-- utils/pipelines/main.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/blueprints/function_calling_blueprint.py b/blueprints/function_calling_blueprint.py index 088951b5..f4739b06 100644 --- a/blueprints/function_calling_blueprint.py +++ b/blueprints/function_calling_blueprint.py @@ -12,7 +12,7 @@ ) # System prompt for function calling -DEFAULT_SYSTEM_RPOMPT = ( +DEFAULT_SYSTEM_PROMPT = ( """Tools: {} If a function tool doesn't match the query, return an empty string. Else, pick a @@ -50,7 +50,8 @@ def __init__(self, prompt: str | None = None) -> None: # The identifier must be an alphanumeric string that can include underscores or hyphens. It cannot contain spaces, special characters, slashes, or backslashes. # self.id = "function_calling_blueprint" self.name = "Function Calling Blueprint" - self.prompt = prompt or DEFAULT_SYSTEM_RPOMPT + self.prompt = prompt or DEFAULT_SYSTEM_PROMPT + self.tools: object = None # Initialize valves self.valves = self.Valves( diff --git a/utils/pipelines/main.py b/utils/pipelines/main.py index 2d064d90..5d335225 100644 --- a/utils/pipelines/main.py +++ b/utils/pipelines/main.py @@ -62,7 +62,7 @@ def pop_system_message(messages: List[dict]) -> Tuple[dict, List[dict]]: return get_system_message(messages), remove_system_message(messages) -def add_or_update_system_message(content: str, messages: List[dict]): +def add_or_update_system_message(content: str, messages: List[dict]) -> List[dict]: """ Adds a new system message at the beginning of the messages list or updates the existing system message at the beginning.