spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/index.html
Apache License 2.0
2.88k stars 721 forks source link

How to use Google AI Studio’s Gemini API in Spring AI #1247

Closed losnahj closed 1 week ago

losnahj commented 3 weeks ago

Below are the properties required to use vertexAI.

spring.ai.vertex.ai.gemini.project-id=PROJECT_ID
spring.ai.vertex.ai.gemini.location=LOCATION
spring.ai.vertex.ai.gemini.chat.options.model=vertex-pro-vision
spring.ai.vertex.ai.gemini.chat.options.temperature=0.5

#Credential
spring.ai.vertex.ai.gemini.credentialsUri

I am using the Google AI Studio Gemini API to call LLM just like I am using OpenAI. However, in Google AI Studio, the only thing related to Credential is the API key. How can I use this as Credential?

KotlinFactory commented 3 weeks ago

Really good question also wondering about that. Would be a shame if spring didnt support such an important api. Gemini 1.5pro experimental is currently on top of the LLM-leaderbords.

csterwa commented 1 week ago

Closing this as duplicate of #1252