markqiu's picture
百度文心一言的例子
569cdb0
raw
history blame contribute delete
533 Bytes
from __future__ import annotations
import unittest
from erniebot_agent.tools.current_time_tool import CurrentTimeTool
class TestCalculatorTool(unittest.TestCase):
def test_schema(self):
calculator = CurrentTimeTool()
function_call_schema = calculator.function_call_schema()
self.assertEqual(function_call_schema["description"], CurrentTimeTool.description)
self.assertEqual(
function_call_schema["responses"]["properties"]["current_time"]["type"],
"string",
)