-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic_usage.py
39 lines (33 loc) · 1000 Bytes
/
basic_usage.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
37
38
39
import asyncio
import os
from dotenv import load_dotenv
from ..augmented import AugmentedLLM
from ..tools.basic_tools import WebSearchTool, CalculatorTool, WeatherTool
async def main():
# Load environment variables
load_dotenv()
# Initialize tools
tools = [
WebSearchTool(),
CalculatorTool(),
WeatherTool()
]
# Initialize augmented LLM with tools and memory
llm = AugmentedLLM(
provider="anthropic", # or "openai"
tools=tools,
enable_memory=True
)
# Example conversation
queries = [
"What's 234 * 456?",
"What's the weather like in London?",
"Can you search for information about quantum computing?",
"What did I ask about earlier regarding calculations?"
]
for query in queries:
print(f"\nUser: {query}")
response = await llm.process(query)
print(f"Assistant: {response}")
if __name__ == "__main__":
asyncio.run(main())