This commit is contained in:
2025-03-26 22:27:24 +03:00
parent c0b07df439
commit 202a091d6e
3 changed files with 7 additions and 2 deletions
@@ -26,7 +26,7 @@ public class KeyboardHelper {
KeyboardRow row2 = new KeyboardRow();
row2.add(new KeyboardButton(BACK));
//keyboardRows.add(row1);
keyboardRows.add(row1);
keyboardRows.add(row2);
ReplyKeyboardMarkup keyboardMarkup = new ReplyKeyboardMarkup(keyboardRows);
@@ -82,7 +82,12 @@ public class OpenRouterServiceImpl implements OpenRouterService {
private String extractResponse(Map<String, Object> response) throws OpenRouterException {
try {
if (response.containsKey("error")) {
log.error("OpenRouter API error in response: {}", response.get("error"));
throw new OpenRouterException("API request failed: " + response.get("error"));
}
if (!response.containsKey("choices")) {
log.error("Invalid API response format{}", response);
throw new OpenRouterException("Invalid API response format");
}
+1 -1
View File
@@ -29,7 +29,7 @@ logging.level.org.springframework.cache=INFO
# OpenRouter AI
openrouter.api.url=https://openrouter.ai/api/v1
openrouter.api.model=deepseek/deepseek-chat-v3-0324
openrouter.api.model=google/gemini-2.5-pro-exp-03-25:free
# Для безопасности лучше установить через переменную окружения: