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

Method main

tests/memory/test_default_memory_zh.py:60–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 import asyncio
59
60 async def main():
61 random_id = str(uuid.uuid4())
62 default_memory = OmegaConf.create({
63 'memory': [{
64 'path': f'output_zh/{random_id}',
65 'user_id': random_id
66 }],
67 })
68 agent1 = LLMAgent(config=default_memory)
69 agent1.config.callbacks.remove('input_callback') # noqa
70 await agent1.run('我是素食主义者,我每天早上喝咖啡')
71 del agent1
72 print('========== 数据准备结束,开始测试 ===========')
73 agent2 = LLMAgent(config=default_memory)
74 agent2.config.callbacks.remove('input_callback') # noqa
75 res = await agent2.run('请帮我准备明天的三餐食谱')
76 print(res)
77 assert ('素' in res[-1].content and '咖啡' in res[-1].content)
78
79 asyncio.run(main())
80

Callers 1

Calls 4

runMethod · 0.95
LLMAgentClass · 0.90
MessageClass · 0.90
ToolCallClass · 0.90

Tested by

no test coverage detected