Spaces:
Sleeping
Sleeping
Update app.py
Browse files180 unmodified lines181182183184185186187188189190191192193194195180 unmodified linesdef __call__(self, question: str) -> str:print(f"Agent received question (first 50 chars): {question[:50]}...")# Check if Ollama is available by making a simple requesttry:import requestsresponse = requests.get("http://localhost:11434/api/version", timeout=5)if response.status_code != 200:raise Exception("Ollama not responding")except Exception as e:print(f"Warning: Ollama not available ({e}), using fallback response")return "I need Ollama to be running locally to provide intelligent responses. Please make sure Ollama is installed and running."try:# Initialize state180 unmodified lines181182183184185186187188189190191192193194195180 unmodified linesdef __call__(self, question: str) -> str:print(f"Agent received question (first 50 chars): {question[:50]}...")# # Check if Ollama is available by making a simple request# try:# import requests# response = requests.get("http://localhost:11434/api/version", timeout=5)# if response.status_code != 200:# raise Exception("Ollama not responding")# except Exception as e:# print(f"Warning: Ollama not available ({e}), using fallback response")# return "I need Ollama to be running locally to provide intelligent responses. Please make sure Ollama is installed and running."try:# Initialize state
app.py+9-9