Fix OpenRouter
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package ru.cathub.telegabot.config;
|
package ru.cathub.telegabot.configuration;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -8,7 +8,7 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.client.RestClientException;
|
import org.springframework.web.client.RestClientException;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import ru.cathub.telegabot.config.OpenRouterConfig;
|
import ru.cathub.telegabot.configuration.OpenRouterConfig;
|
||||||
import ru.cathub.telegabot.exception.OpenRouterException;
|
import ru.cathub.telegabot.exception.OpenRouterException;
|
||||||
import ru.cathub.telegabot.service.OpenRouterService;
|
import ru.cathub.telegabot.service.OpenRouterService;
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ public class OpenRouterServiceImpl implements OpenRouterService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String extractResponse(Map<String, Object> response) {
|
private String extractResponse(Map<String, Object> response) throws OpenRouterException {
|
||||||
try {
|
try {
|
||||||
List<Map<String, Object>> choices = (List<Map<String, Object>>) response.get("choices");
|
List<Map<String, Object>> choices = (List<Map<String, Object>>) response.get("choices");
|
||||||
Map<String, Object> firstChoice = choices.get(0);
|
Map<String, Object> firstChoice = choices.get(0);
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
spring.application.name=TelegaBot
|
|
||||||
# Telegram configuration
|
|
||||||
bot.token=5908676914:AAGU9LVyXYZYafpRgwOf1tolk0HGYvcHszY
|
|
||||||
bot.name=TelegaBot
|
|
||||||
|
|
||||||
# Database configuration
|
|
||||||
|
|
||||||
|
|
||||||
spring.jpa.hibernate.ddl-auto=validate
|
|
||||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
|
|
||||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
|
||||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
|
||||||
|
|
||||||
|
|
||||||
spring.datasource.url=jdbc:postgresql://192.168.0.10:5432/telegabot
|
|
||||||
spring.datasource.username=postgres
|
|
||||||
spring.datasource.password=Vftrixpo05
|
|
||||||
|
|
||||||
# Flyway Configuration
|
|
||||||
spring.flyway.enabled=true
|
|
||||||
spring.flyway.locations=classpath:db/migration
|
|
||||||
spring.flyway.baseline-on-migrate=true
|
|
||||||
spring.flyway.validate-on-migrate=true
|
|
||||||
spring.flyway.Schemas=telegabot
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ?????????? SQL-???????
|
|
||||||
spring.jpa.show-sql=true
|
|
||||||
spring.jpa.properties.hibernate.format_sql=false
|
|
||||||
|
|
||||||
# ?????????? ????????? ????????
|
|
||||||
logging.level.org.hibernate.SQL=DEBUG
|
|
||||||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
|
||||||
logging.level.io.hypersistence.utils.hibernate.query=DEBUG
|
|
||||||
|
|
||||||
# ??????????? ????
|
|
||||||
logging.level.org.springframework.cache=INFO
|
|
||||||
Reference in New Issue
Block a user