You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use latest version of Google Gemini-1.5-pro via API or SDK that can be integrated to our projects.
What problem are you trying to solve with this feature?
Solving the whole codebase upload media and more with 1 Million tokens limit to achieve maximum efficiency from this model.
Any other information you'd like to share?
Here is error i got
Error generating response: 404 models/gemini-1.5-pro-latest is not found for API version v1beta, or is not supported for GenerateContent. Call ListModels to see the list of available models and their supported methods.
Here is the code:
importosimportgoogle.generativeaiasgenaifromdotenvimportload_dotenvdefinit_api_keys():
try:
load_dotenv()
api_key=os.getenv("GEMINI_API_KEY")
genai.configure(api_key=api_key)
exceptExceptionasexception:
print("Error in initializing API keys:", exception)
raisedefgenerate_response(prompt:str):
# Set up the modelgeneration_config= {
"temperature": 0.1,
"top_p": 1,
"top_k": 1,
"max_output_tokens": 2048,
}
model=genai.GenerativeModel(model_name="gemini-1.5-pro-latest",generation_config=generation_config)
prompt_parts= [prompt]
try:
response=model.generate_content(prompt_parts)
print(response.text)
exceptExceptionasexception:
print("Error generating response:", exception)
if__name__=="__main__":
init_api_keys()
prompt=input("> ")
generate_response(prompt)
Description of the feature request:
I want to use latest version of Google Gemini-1.5-pro via API or SDK that can be integrated to our projects.
What problem are you trying to solve with this feature?
Solving the whole codebase upload media and more with 1 Million tokens limit to achieve maximum efficiency from this model.
Any other information you'd like to share?
Here is error i got
Here is the code: