Testing with qwen and updating tools
This commit is contained in:
@@ -11,7 +11,8 @@ class BaseTelegramInferenceBot(ABC):
|
||||
self.processing_status = {}
|
||||
self.system_prompt = self.load_system_prompt()
|
||||
self.tools, self.functions = self.load_functions()
|
||||
print(f'Github Token: {os.environ.get("GITHUB_TOKEN")}')
|
||||
print(f'System Prompt: {os.environ.get("SYSTEM_PROMPT_PATH")}')
|
||||
print(f'Github Repository: {os.environ.get("GITHUB_REPOSITORY")}')
|
||||
|
||||
@staticmethod
|
||||
def load_system_prompt():
|
||||
@@ -59,8 +60,10 @@ class BaseTelegramInferenceBot(ABC):
|
||||
function_name = function_call_name
|
||||
function_args = json.loads(function_call_arguments if function_call_arguments is not None else "{}")
|
||||
for tool in self.tools:
|
||||
if function_name in [f["name"] for f in tool.get_functions()]:
|
||||
return tool.execute(function_name, **function_args)
|
||||
for function in tool.get_functions():
|
||||
if function["function"]["name"] == function_name:
|
||||
return tool.execute(function_name, **function_args)
|
||||
|
||||
|
||||
@abstractmethod
|
||||
async def start(self):
|
||||
|
||||
Reference in New Issue
Block a user