grantforge-api / backend /scratch_test_tools.py
GrantForge Bot
Deploy sha-9a5957fcdef15b7e2623f8b147cda6026475aee0 — source build (no GHCR)
3a3734f
Raw
History Blame Contribute Delete
453 Bytes
import sys
import os
sys.path.insert(0, os.path.abspath("backend"))
from core.llm_router import get_llm
from langchain_core.tools import tool
@tool
def dummy_tool(x: int) -> int:
"""Returns x + 1"""
return x + 1
llm = get_llm(task_type="standard", tools=[dummy_tool])
print("Model initialized:", llm)
try:
response = llm.invoke("What is dummy_tool(5)? Use the tool.")
print(response)
except Exception as e:
print(f"Error: {e}")