mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-08 16:13:41 +00:00
UI: Clean up tool calling code
This commit is contained in:
parent
4c7a56c18d
commit
286ae475f6
2 changed files with 18 additions and 25 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import importlib.util
|
||||
import json
|
||||
import random
|
||||
|
||||
from modules import shared
|
||||
from modules.logging_colors import logger
|
||||
|
|
@ -49,12 +48,6 @@ def load_tools(selected_names):
|
|||
return tool_defs, executors
|
||||
|
||||
|
||||
def generate_tool_call_id():
|
||||
"""Generate a unique tool call ID (e.g. 'call_a1b2c3d4')."""
|
||||
chars = "abcdefghijklmnopqrstuvwxyz0123456789"
|
||||
return "call_" + "".join(random.choice(chars) for _ in range(8))
|
||||
|
||||
|
||||
def execute_tool(func_name, arguments, executors):
|
||||
"""Execute a tool by function name. Returns result as a JSON string."""
|
||||
fn = executors.get(func_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue