"""
第十二章示例2:BFCL快速开始
对应文档:12.2.5 在HelloAgents中实现BFCL评估 - 方式1
这是最简单的BFCL评估方式,一行代码完成评估、报告生成和官方评估。
"""
from hello_agents import SimpleAgent, HelloAgentsLLM
from hello_agents.tools import BFCLEvaluationTool
llm = HelloAgentsLLM()
agent = SimpleAgent(name="TestAgent", llm=llm)
bfcl_tool = BFCLEvaluationTool()
results = bfcl_tool.run(
agent=agent,
category="simple_python",
max_samples=5
)
print(f"准确率: {results['overall_accuracy']:.2%}")
print(f"正确数: {results['correct_samples']}/{results['total_samples']}")