23 lines
617 B
Python
23 lines
617 B
Python
import llm
|
|
import json
|
|
from llm_tools_tricu_bridge import tricu-bridge
|
|
|
|
|
|
def test_tool():
|
|
model = llm.get_model("echo")
|
|
chain_response = model.chain(
|
|
json.dumps(
|
|
{
|
|
"tool_calls": [
|
|
{"name": "tricu-bridge", "arguments": {"input": "pelican"}}
|
|
]
|
|
}
|
|
),
|
|
tools=[tricu-bridge],
|
|
)
|
|
responses = list(chain_response.responses())
|
|
tool_results = json.loads(responses[-1].text())["tool_results"]
|
|
assert tool_results == [
|
|
{"name": "tricu-bridge", "output": "hello pelican", "tool_call_id": None}
|
|
]
|