Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public ChatService(RestTemplate restTemplate) {
}

public String getReply(String message) {
// gemini-1.5-flash is stable and widely available
String model = "gemini-1.5-flash";
// gemini-2.5-flash is the currently available stable model
String model = "gemini-2.5-flash";

String url = "https://generativelanguage.googleapis.com/v1beta/models/"
+ model + ":generateContent?key=" + geminiApiKey;
Expand Down
2 changes: 1 addition & 1 deletion chatbotbackend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring.application.name=chatbotbackend
server.port=8081

gemini.api.key=${GEMINI_API_KEY:AIzaSyBwHCrncxqEthTD7InYqx076QLezlaxRa8}
gemini.api.key=${GEMINI_API_KEY:AIzaSyB6KNlC2izJgPLkNeVomwpzhZbDKu3XrrM}

# KAFKA DISABLED
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
Expand Down
16 changes: 16 additions & 0 deletions test_gemini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

async function listModels() {
const apiKey = "AIzaSyB6KNlC2izJgPLkNeVomwpzhZbDKu3XrrM";
const url = `https://generativelanguage.googleapis.com/v1beta/models?key=${apiKey}`;

const response = await fetch(url);
const data = await response.json();
if (data.models) {
console.log("Available models:");
data.models.filter(m => m.supportedGenerationMethods.includes("generateContent")).forEach(m => console.log(m.name, m.version));
} else {
console.log(data);
}
}

listModels();
Loading