-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
36 lines (25 loc) · 1.02 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import asyncio
from chatlas import ChatBedrockAnthropic
from openapi_mcp.client import MCPClient
async def main():
llm = ChatBedrockAnthropic(
model="anthropic.claude-3-5-sonnet-20240620-v1:0",
aws_region="us-east-1",
)
mcp_client = MCPClient(llm)
await mcp_client.register_mcp_server("http://127.0.01:8082/sse")
if True:
mcp_client.llm.app(bg_thread=True)
await asyncio.sleep(1000)
else:
# await mcp_client.chat_async("What is the current Connect host version?")
await mcp_client.chat_async("Get the current user's id.")
# await mcp_client.chat_async("Now get me the first 3 content items owned by that user id.")
# Works! Just commenting for now
# await mcp_client.chat_async("Update that user's first name to `Testing`")
mcp_client.llm.export(
"output.md", overwrite=True, include="all", include_system_prompt=True
)
await mcp_client.cleanup()
if __name__ == "__main__":
asyncio.run(main())