MCPcopy Create free account
hub / github.com/modelscope/ms-agent / setUp

Method setUp

tests/memory/test_default_memory.py:13–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11class TestDefaultMemory(unittest.TestCase):
12
13 def setUp(self) -> None:
14 self.tool_history = [
15 Message(
16 role='user',
17 content=
18 'Help me find the coolest sports park in Chaoyang District, Beijing. Remember this location for next'
19 'time.'),
20 Message(
21 role='assistant',
22 content=
23 '\nThe user wants to find the coolest sports park in Chaoyang District, Beijing. The keyword "cool" '
24 'suggests they are not just looking for functionality, but also value high-tech design, interactive '
25 'experiences, and trendy elements. Therefore, I need to search for venues that have a futuristic feel, '
26 'integrate advanced technology, youth culture, or innovative facilities.\n\nTo solve this, I will take '
27 'the following steps:\n'
28 '1. Use the awesome_map-search tool to search for sports parks in Chaoyang District, Beijing, focusing '
29 'on keywords like "cool", "high-tech", "trendy", etc.\n'
30 '2. Filter out the most distinctive, highly-rated parks with strong visual impact\n'
31 '3. Provide the name of the sports park.\n\nNow I will call the awesome_map-search tool. This tool is '
32 'designed specifically for geo + fun information retrieval, '
33 'supports semantic queries, and excels at discovering "hidden gem" locations.',
34 tool_calls=[
35 ToolCall(
36 id='call_xyz789CoolPark',
37 type='function',
38 tool_name='awesome_map-search',
39 arguments=
40 '{"query": "Beijing Chaoyang District coolest sports park high-tech trendy must-visit spot", '
41 '"max_results": 1, "result_type":'
42 '"detailed", "include_features": true}')
43 ]),
44 Message(
45 role='tool',
46 content=
47 '[{"park_name": "Quantum Leap · Chaoyang Future Sports Dome", "address": "No. 8888 Jiuxianqiao Road, '
48 'Chaoyang District, Beijing", "features": ["Anti-gravity floating track using magnetic levitation '
49 'cushioning tech — running feels like jumping on the moon", "AR extreme climbing wall supporting '
50 'virtual scenes such as volcanic apocalypse and interstellar maze", "DJ-powered cycling pods: the '
51 'faster you pedal, the more intense the music, with real-time energy waveform visualization", '
52 '"AI coach robot \'Tie Ran\', which creates custom workout plans and motivates users in Northeastern '
53 'Chinese dialect", "Glow-in-the-dark Tai Chi lake with floating yoga platforms; water contains '
54 'eco-friendly bioluminescent algae glowing blue at night"], "special_events": ["Cool Sports Event '
55 'every Friday night: laser dodgeball, glow-in-the-dark dance run, robot tug-of-war"], "tips": ["Must '
56 'solve 3 fitness puzzles to unlock entry", "Bring a power bank — taking photos too frequently drains '
57 'battery quickly"], "rating": 9.9, "opening_hours": "6:00 - 23:00", "admission": "Free"}]'
58 ),
59 Message(
60 role='assistant',
61 content=
62 '\nThe user wanted to find the coolest sports park in Chaoyang District, Beijing. I have retrieved '
63 'relevant information via the awesome_map-search tool.\n\n## 🌟 The Coolest Sports Park in Chaoyang '
64 'District, Beijing Revealed: 「Quantum Leap · Chaoyang Future Sports Dome」'
65 ),
66 Message(role='user', content='Alright, bye!')
67 ]
68
69 def tearDown(self):
70 import shutil

Callers

nothing calls this directly

Calls 2

MessageClass · 0.90
ToolCallClass · 0.90

Tested by

no test coverage detected