import os
import asyncio
from dotenv import load_dotenv
from agent import ResearchAgent
# Load environment variables
load_dotenv()
async def main():
print("Starting Research Assistant Agent (LangChain version)...")
# Initialize the agent
agent = ResearchAgent()
print("\nResearch Assistant is ready! Type 'exit' to quit.\n")
while True:
# Get user input
user_input = input("You: ")
# Exit condition
if user_input.lower() in ["exit", "quit", "bye"]:
print("Goodbye!")
break
try:
# Process the query with LangChain agent
response = await agent.process_query(user_input)
print(f"\nAssistant: {response}\n")
except Exception as e:
print(f"Error processing with LangChain agent: {str(e)}")
if __name__ == "__main__":
# Run the main function
asyncio.run(main())
import os
import asyncio
from dotenv import load_dotenv
from agent import ResearchAgent
# Load environment variables
load_dotenv()
async def main():
print("Starting Research Assistant Agent (Anthropic Claude version)...")
try:
# Initialize the Anthropic-based agent
agent = ResearchAgent()
print("\nResearch Assistant is ready! Type 'exit' to quit.\n")
while True:
# Get user input
user_input = input("You: ")
# Exit condition
if user_input.lower() in ["exit", "quit", "bye"]:
print("Goodbye!")
break
try:
# Process the query with Anthropic-based agent
response = await agent.process_query(user_input)
print(f"\nAssistant: {response}\n")
except Exception as e:
print(f"Error in Claude API request: {str(e)}")
except ValueError as e:
# Handle missing API key error
print(f"Configuration error: {str(e)}")
print("Please make sure ANTHROPIC_API_KEY is set in your .env file")
if __name__ == "__main__":
# Run the main function
asyncio.run(main())