Testing with qwen and updating tools

This commit is contained in:
2025-06-01 11:50:12 -05:00
parent 4c4f9b7f2c
commit 7844f26d59
6 changed files with 418 additions and 311 deletions
+6 -3
View File
@@ -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):