From 31a041e300e48018b8886914c673d57435191f63 Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 17 Aug 2024 18:50:30 -0500 Subject: [PATCH] Update tool use count limit to 50 --- telegram_inference_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram_inference_bot.py b/telegram_inference_bot.py index 87dc92f..7dac149 100644 --- a/telegram_inference_bot.py +++ b/telegram_inference_bot.py @@ -134,7 +134,7 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) -> assistant_message = response.choices[0].message toolUseCount = 0 if hasattr(assistant_message, 'function_call') and assistant_message.function_call: - while hasattr(assistant_message, 'function_call') and assistant_message.function_call and toolUseCount < 10: + while hasattr(assistant_message, 'function_call') and assistant_message.function_call and toolUseCount < 50: # Todo: put amount in env tool_response = call_tool(assistant_message.function_call, messages) conversation_history[user_id].append({"role": "function", "name": assistant_message.function_call.name, "content": json.dumps(tool_response)})