Clean up OpenRouterService
This commit is contained in:
@@ -45,8 +45,6 @@ public class OpenRouterService {
|
||||
.uri(URI.create(OPENROUTER_URL))
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Authorization", "Bearer " + apiKey)
|
||||
.header("HTTP-Referer", "https://petshop.local")
|
||||
.header("X-Title", "Leon's Pet Store AI Assistant")
|
||||
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
|
||||
.timeout(Duration.ofSeconds(60))
|
||||
.build();
|
||||
@@ -63,12 +61,7 @@ public class OpenRouterService {
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new RuntimeException("AI request was interrupted", e);
|
||||
}
|
||||
|
||||
catch (RuntimeException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException("Failed to call OpenRouter API: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user