Made changes to suit Openwebui
This commit is contained in:
@@ -212,12 +212,17 @@ class ModelService:
|
||||
|
||||
# Make the API call to Ollama
|
||||
try:
|
||||
# Prepare headers with API key
|
||||
headers = {"Content-Type": "application/json"}
|
||||
if self.openwebui_api_key:
|
||||
headers["Authorization"] = f"Bearer {self.openwebui_api_key}"
|
||||
|
||||
# Ollama API endpoint is /api/chat or /api/generate
|
||||
response = requests.post(
|
||||
f"{self.ollama_api_url}/api/generate",
|
||||
headers={"Content-Type": "application/json"},
|
||||
headers=headers,
|
||||
json=request_json,
|
||||
timeout=30
|
||||
timeout=60
|
||||
)
|
||||
|
||||
response.raise_for_status()
|
||||
|
||||
Reference in New Issue
Block a user