Fixes
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
# Для безопасности лучше установить через переменную окружения:
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user