MCPcopy
hub / github.com/zai-org/Open-AutoGLM / example_basic_task

Function example_basic_task

examples/basic_usage.py:15–41  ·  view source on GitHub ↗

Basic task example / 基础任务示例

(lang: str = "cn")

Source from the content-addressed store, hash-verified

13
14
15def example_basic_task(lang: str = "cn"):
16 """Basic task example / 基础任务示例"""
17 msgs = get_messages(lang)
18
19 # Configure model endpoint
20 model_config = ModelConfig(
21 base_url="http://localhost:8000/v1",
22 model_name="autoglm-phone-9b",
23 temperature=0.1,
24 )
25
26 # Configure Agent behavior
27 agent_config = AgentConfig(
28 max_steps=50,
29 verbose=True,
30 lang=lang,
31 )
32
33 # Create Agent
34 agent = PhoneAgent(
35 model_config=model_config,
36 agent_config=agent_config,
37 )
38
39 # Execute task
40 result = agent.run("打开小红书搜索美食攻略")
41 print(f"{msgs['task_result']}: {result}")
42
43
44def example_with_callbacks(lang: str = "cn"):

Callers 1

basic_usage.pyFile · 0.85

Calls 5

runMethod · 0.95
get_messagesFunction · 0.90
ModelConfigClass · 0.90
AgentConfigClass · 0.90
PhoneAgentClass · 0.90

Tested by

no test coverage detected