Skip to content

Commit 3449d49

Browse files
committed
adjustment tools directory.
1 parent 5cc90a9 commit 3449d49

33 files changed

+508
-482
lines changed
File renamed without changes.

examples/shortest_path/shortest_path_demo.py renamed to examples/fh_tools/shortest_path/shortest_path_demo.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import os
2+
3+
from function_hubs.shortest_path import shortest_path_tools
24
from oxygent import MAS, Config, oxy
3-
from oxygent.shortest_path.shortest_path import shortest_path_tools
45

56
Config.set_agent_llm_model("default_llm")
67

8+
79
def create_optimal_agent():
810
return oxy.ReActAgent(
911
name="shortest_path_agent",
@@ -21,6 +23,8 @@ def create_optimal_agent():
2123
is_multimodal_supported=False,
2224
semaphore=2,
2325
)
26+
27+
2428
oxy_space = [
2529
oxy.HttpLLM(
2630
name="default_llm",
@@ -38,14 +42,17 @@ def create_optimal_agent():
3842
oxy.ReActAgent(
3943
is_master=True,
4044
name="master_agent",
41-
sub_agents=["excel_agent","shortest_path_agent"],
45+
sub_agents=["excel_agent", "shortest_path_agent"],
4246
),
4347
]
4448

49+
4550
async def main():
4651
async with MAS(oxy_space=oxy_space) as mas:
4752
await mas.start_web_service(first_query="")
4853

54+
4955
if __name__ == "__main__":
5056
import asyncio
51-
asyncio.run(main())
57+
58+
asyncio.run(main())
File renamed without changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import asyncio
2+
import os
3+
4+
from function_hubs import train_ticket_tools
5+
from oxygent import MAS, oxy
6+
7+
oxy_space = [
8+
oxy.HttpLLM(
9+
name="default_llm",
10+
api_key=os.getenv("DEFAULT_LLM_API_KEY"),
11+
base_url=os.getenv("DEFAULT_LLM_BASE_URL"),
12+
model_name=os.getenv("DEFAULT_LLM_MODEL_NAME"),
13+
llm_params={"temperature": 0.01},
14+
semaphore=4,
15+
),
16+
train_ticket_tools.train_ticket_tools,
17+
oxy.ReActAgent(
18+
name="train_ticket_agent",
19+
tools=["train_ticket_tools"],
20+
trust_mode=False,
21+
llm_name="default_llm",
22+
),
23+
]
24+
25+
26+
async def main():
27+
async with MAS(oxy_space=oxy_space) as mas:
28+
await mas.start_web_service(
29+
first_query="请帮我查询明天从西安到北京的火车票",
30+
welcome_message="您好我是火车票查询智能体,非常高兴为您服务。您可以这样问我:\n"
31+
'"明天从西安到北京的火车票"\n'
32+
'"下周一上海到北京的卧铺火车票"\n'
33+
'"后天西安到杭州的火车票多少钱"\n'
34+
'"明天北京到西安的火车最短运行时间是多长"\n\n'
35+
"Hello, I am a train ticket inquiry assistant, and I am very happy to assist you. "
36+
"You can ask me questions like:\n"
37+
'"Train tickets from Xi\'an to Beijing tomorrow"\n'
38+
'"Sleeper train tickets from Shanghai to Beijing next Monday"\n'
39+
'"How much are train tickets from Xi\'an to Hangzhou the day after tomorrow"\n'
40+
'"What is the shortest travel time for trains from Beijing to Xi\'an tomorrow"\n',
41+
)
42+
43+
44+
if __name__ == "__main__":
45+
asyncio.run(main())

examples/mcp_tools/train_ticket_agent_demo.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)