MCPcopy Index your code
hub / github.com/AI45Lab/Code / test_data_file_chart

Function test_data_file_chart

examples/test_chart_generator.py:29–58  ·  view source on GitHub ↗

Test chart generation from data file

()

Source from the content-addressed store, hash-verified

27 print()
28
29def test_data_file_chart():
30 """Test chart generation from data file"""
31 print("=" * 60)
32 print("Test 2: Chart from Data File")
33 print("=" * 60)
34
35 # Create sample data file
36 import json
37 data = {
38 "products": [
39 {"name": "Product A", "sales": 450},
40 {"name": "Product B", "sales": 380},
41 {"name": "Product C", "sales": 520},
42 {"name": "Product D", "sales": 180}
43 ]
44 }
45
46 with open("/tmp/sales_data.json", "w") as f:
47 json.dump(data, f)
48
49 agent = Agent.create("agent.acl")
50 session = agent.session(".", builtin_skills=True)
51
52 result = session.send("""
53 Read /tmp/sales_data.json and create a bar chart
54 showing product sales. Use vis-chart format.
55 """)
56
57 print(result.text)
58 print()
59
60def test_multiple_charts():
61 """Test generating multiple charts"""

Callers 1

Calls 3

createMethod · 0.45
sessionMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected