Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

VertexAI Gemini Safety Settings: How to determine offending text?

Gemini SAFETY_SETTINGS used: I used to use BLOCK_NONE but a week or so ago, the API starting blocking this unless you pay $40k/mo. in fees (at least that is what the URL in the error code stated). ...
SeaDude's user avatar
  • 4,235
0 votes
0 answers
19 views

Why do I get an UnidentifiedImageError error when doing step 4 of Build a Q&A App with Multi-Modal RAG using Gemini Pro tutorial?

Hi I'm trying to follow the tutorial "Build a Q&A App with Multi-Modal RAG using Gemini Pro" at https://codelabs.developers.google.com/multimodal-rag-gemini#6. I've ran all the code from ...
rakista112's user avatar
-2 votes
0 answers
37 views

Get the last message sent by WhatsApp Web (Python)

This is my first post, I'm doing a personal project to use the Gemini API to respond to messages on WhatsApp Web. However, I have a problem with 'get' in the last message. I'm a beginner, I'd like to ...
Vinícius Marçal's user avatar
0 votes
0 answers
32 views

As I'm working on Gemini AI and I encounter a issue for token limit

I need to load a file and ask the Gemini LLM to answer the questions regrading from the loaded file. I need to inject a 19kb JSON file. When I try to ingest the file, it says: "raise exceptions....
Sirajudeen's user avatar
0 votes
0 answers
24 views

Send text to Gemini API as stream

I'm building an application that is doing speech-to-text Google Cloud Speech to text and then text translation using Gemini-flash LLM. I receive the text from the speech-to-text API as chunk, with ...
MohamedLEGH's user avatar
0 votes
0 answers
11 views

Documentation's Quickstart python code for google-gemini stalls

import google.generativeai as genai genai.configure(api_key="XXXXXREDACTEDXXXXX") model = genai.GenerativeModel('gemini-1.5-flash') response = model.generate_content("Give me python ...
heman's user avatar
  • 3
-1 votes
1 answer
60 views

Error 400: Invalid JSON payload received when calling Google Generative Language API

I'm having trouble with generating text using the Google Generative Language API. Specifically, I'm receiving a 400 Bad Request error with the message: Invalid JSON payload received. Unknown name &...
Rayan CH TFG's user avatar
0 votes
0 answers
23 views

How to get Gemini Flash to generate content with schema containing date/ datetime as a field?

I have a Pydantic class with datetime field which I would like to specify as the response schema in Gemini Flash. Error received is Exception has occurred: InvalidArgument 400 * GenerateContentRequest....
umo's user avatar
  • 21
0 votes
0 answers
48 views

How to pass bytes (base64) instead of string (utf-8) to Gemini using requests package in Python?

I would like to use the streamGenerateContent method to pass an image/pdf/some other file to Gemini and have it answer a question about a file. The file would be local and not stored on Google ...
geotolky's user avatar
0 votes
1 answer
49 views

How to find the URL of Generative Language API and make the API usable?

I'm currently working on integrating an AI-powered API into my React Native app, but I’m encountering issues with generating text. Specifically, I’m using Google’s Generative Language API (Gemini) via ...
Rayan CH TFG's user avatar
0 votes
1 answer
63 views

How can I programatically interact with Google Dialogflow's new Agent feature?

Recently, Google launched a new tool to build conversation agents using Gemini and Dialogflow. It is a new feature and I tried testing it out via the console where I am able to get it to work for ...
Anshuman Kumar's user avatar
0 votes
1 answer
58 views

Firebase Genkit: how to set system / user /assistant chat history?

I am trying to use Firebase Genkit. I see here that I can use: import { generate } from '@genkit-ai/ai'; generate({ model: 'googleai/gemini-1.5-flash-latest', prompt: 'You are a helpful AI ...
toto_tata's user avatar
  • 15.2k
1 vote
1 answer
69 views

ImportError: cannot import name 'Gemini' from 'llama_index.llms' (unknown location)

This is the code !pip install google-generativeai !pip install llama-index-llms-gemini !pip install llama-index llama-index-llms-gemini from llama_index.core import VectorStoreIndex, StorageContext ...
Piyush Joshi's user avatar
0 votes
1 answer
136 views

Gemini API Error 400: Invalid or Unsupported File URI

I am trying to build an Android app using a no-code platform but there are certain features that the platform doesn't offer. I want to prompt Gemini with an Image file using the API. I have created an ...
Varun Kadapatti's user avatar
0 votes
1 answer
54 views

PermissionDenied: 403 You do not have permission to access tuned model

I have tuned a gemini base model and wrote a python code to access it but unfortunatelly I keep getting the error "PermissionDenied: 403 You do not have permission to access tuned model". I ...
Jonathan Livingston Seagull's user avatar
0 votes
0 answers
82 views

Using Audio in the Gemini API

I am trying to use the Gemini API using the Swift SDK but also using URLSession to process audio as inline data. let fileData = try Data(contentsOf: fileUrl) let model = GenerativeModel(name: "...
someone's user avatar
  • 137
0 votes
1 answer
225 views

Does Gemini API Support all file mime types

I am developing a tool that describes what a file is, using Gemini api. However, I had came into this issue of getting an error 400 Unsupported MIME type, when I uploaded a .docx type file. Does the ...
UnfreeHeX's user avatar
1 vote
1 answer
67 views

Using REGEX to Handle Nested Double Quotes in JSON Strings in Python

I'm using Generative AI API to return text responses as JSON strings which I intend to feed data into an application in real time. The problem is that often the JSON response provided by GenAI API ...
ashap551's user avatar
0 votes
1 answer
54 views

How aistudio can use directly file from Google Drive with code

When I select a large file from google drive on Googles AI Studio. Googles AI Studio loads my file very fast. However when I use code (Nodejs), I need to download this file from then upload this file ...
Hoàng Quốc Việt's user avatar
1 vote
1 answer
91 views

Passing URLs as video paths in @google/generative AI and Next.js

I'm looking for a solution to upload videos from a URL when using @google/generative-ai in Next.js. I have figured out how to use videos that are stored on my machine, but not on external sources. ...
kool's user avatar
  • 94
-1 votes
2 answers
616 views

Gemini 1.0 Pro Vision has been deprecated on July 12, 2024. Consider switching to different model, for example gemini-1.5-flash

I'm following the instructions of 5. Call the Gemini API with images from Automate Google Workspace tasks with the Gemini API. When running testGeminiVision, I got a truncated error message suggesting ...
Wicket's user avatar
  • 37.5k
-1 votes
1 answer
141 views

Error: [GoogleGenerativeAI Error]: Error fetching from ..: [400 ] API key not valid. Please pass a valid API key

i am getiing this error: Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent: [400 ] API key not valid. ...
Bharat Kasera's user avatar
0 votes
0 answers
98 views

Trying out gemini-1.5-flash on Jupyter Notebook

I am new to Stack Overflow. Looking forward to everyone's guidance. I am trying to run Gemini-1.5-flash on my desktop's Jupyter Notebook which is running Python. I managed to get the following code to ...
drakelamyh's user avatar
0 votes
0 answers
33 views

How to Improve Indexing of OCR-Extracted Text Using Langchain and Gemini Flash with Textract Data?

I am using ChartVertexAI with Langchain, specifically the Gemini-1.5-Flash-001 model, for OCR tasks to extract details from documents. Due to budget constraints, I am unable to switch to a "Pro&...
Sagar Pulluru's user avatar
0 votes
1 answer
41 views

Cannot call Google Gemini API functions in SAPUI5 App

I have integrated Gemini API in SAPUI5 app and the results are coming as well. I am able to get the response JSON when the API key is inserted and can see what models are available. But not able to ...
SAP ASFlash's user avatar
1 vote
0 answers
166 views

How to suppress terminal warnings when dockerizing a FastAPI LangChain application using the Gemini API?

Docker logs: I'm working on a FastAPI application integrated with LangChain and using the Gemini API. I've dockerized the application, but when I run it, I encounter several warnings in the terminal ...
Denuwan Kalubowila's user avatar
0 votes
0 answers
58 views

Gemini Status 429 no matter what

I'm unsure of why on earth my Google Gemini requests are returning status 429 resource exhausted. It definitely isn't because my resource is exhausted! This exact code worked a couple weeks ago...ugh. ...
ericOnline's user avatar
  • 1,907
0 votes
1 answer
137 views

LLM unable to reliably retrieve nodes or information from a knowledge graph using LangChain

I have a very simple knowledge graph (a toy version compared to the actual one I am working with, but I am experiencing similar issues with both) made from a table. The graph was created by using ...
Topher's user avatar
  • 1
0 votes
1 answer
32 views

What are Tokens, Top K and Top P? [closed]

I'm learning to use Google AI Studio and when generating the snippet I came across these terms: const generationConfig = { temperature: 1, topP: 0.95, topK: 64, maxOutputTokens: 8192, ...
Samuel A. Souza's user avatar
-1 votes
1 answer
108 views

why i am not receiving the google gemini response in formated paragraphs in html page

I Am using a google gemini api in my django, everything is going fine, response generated my gemini in terminal is perfect with space between two paragraph and all, but when i am passing this response ...
Dev Yash's user avatar
0 votes
0 answers
75 views

Vertex AI Function Calling Fails to Escape Quote

I'm using Gemini 1.5 Pro on Vertex AI to tag attributes about people. I'm using the forced function calling feature to force the model to output JSON in the provided schema. One of the attributes is a ...
Aaron Berger's user avatar
0 votes
0 answers
70 views

pydantic.v1.error_wrappers.ValidationError: 2 validation errors for multiplySchema for langchain AgentExecutor with Gemini-pro

Facing an issue with using AgentExecutor while using the ChatGoogleGenerativeAI. Integration of the AI agent with tools works fine. But when I use the AgentExecutor, it thorws this error message. I ...
N. Vakharia's user avatar
0 votes
0 answers
47 views

GCP Gemini API - Send multimodal prompt requests using local video

Hope someone can help. The sample code shows how to send multimodal prompt requests with locally stored images: import vertexai from vertexai.generative_models import GenerativeModel, Part, Image ...
user26612066's user avatar
1 vote
0 answers
45 views

How can I automatically run code while making alterations to my code?

I have the following code, which uses the Google Gemini API to process a file called "pdf_texts_79_batch_#.txt." The "#" in the file name stands for a number that starts at one and ...
Shriyan Yamali's user avatar
0 votes
1 answer
78 views

Gemini API keys usage per API key

Currently, I'm using the API key separately for each client. I have no idea how to know the usage cost for each API key. I want to know the usage cost per API key for generating the invoice for ...
Win Nandar Soe's user avatar
2 votes
1 answer
64 views

Can't find variable: require at global code@

I'm new to JavaScript and was trying to import the Google Gemini library to use its AI. However, I'm facing an issue when I use the "require" keyword: ERROR: Can't find variable: require at ...
Francesco Zanoncelli's user avatar
0 votes
0 answers
131 views

Gemini Maintaining Chat History for Multi-Turn Conversations with Python Server and React Native Client

I'm developing a React Native app where I send requests to my Python server and get responses from the Gemini AI. However, I'm facing an issue with maintaining chat history for multi-turn ...
user14990172's user avatar
0 votes
0 answers
82 views

How can I upload/send an image to multi-modal LLMs like Google's Gemini-Flash using Langchain JS?

I've been digging in the Langchain documentation (and type definitions) and even asked LLMs how I can upload or send an image to multi-modal LLMS, but I haven't found anything. This is my current code:...
Jose A's user avatar
  • 10.9k
0 votes
0 answers
20 views

Changing Gemini Browser Interface so Return doesn't Post the Question

When using (Google) Gemini in the Chrome browser (or Edge), it's normal to want to do multiline inputs. This can be done with shift-return (or equivalently shift-enter). But the tendency is so ...
GPU Programmer's user avatar
1 vote
0 answers
40 views

Passing images from browser input uploads to GoogleAIFileManager

I am building a demo on prompting with Gemini and images uploaded from the browser input utility. so on the client side - React application, the images are extracted via Html input: <input type=&...
Christopher Maduka's user avatar
0 votes
0 answers
176 views

Google Gemini (Vertex AI) Raising RECITATION errors upon Docker containerization

I'm trying to use Gemini 1.5 Flash to generate JSON data from text documents. Originally, I was running into the following issues related to copyright: Unexpected error during attempt 5: Cannot get ...
Avik Samanta's user avatar
1 vote
2 answers
233 views

Google Cloud vertex Ai PERMISSION_DENIED when accessing project

I have spent many hours trying to track down the solution to a problem with sending a (JWT/OAuth2 authorised) query (with PHP/cURL) to what I think is a GC endpoint model (see below). I keep getting ...
Dr Phil Hughes's user avatar
0 votes
0 answers
76 views

VertexAI API Error Code 13 on Specific Inputs

When using the VertexAI API, it works 80% of the time, but every fifth file being processed errors out with Error message: "Internal error encountered." Status: 500 Error code: 13. GCP docs (...
CoderOfTheNight's user avatar
0 votes
1 answer
64 views

My Android app is unable to import a com.google.mlkit library but can import others

I'm trying to implement Gemini AI in my app and I'm stuck at this point: I'm able to import com.google.mlkit.nl.smartreply.SmartReplySuggestion and com.google.mlkit.nl.smartreply.TextMessage but not ...
FractalBob's user avatar
  • 3,504
0 votes
0 answers
35 views

String searching in Google Gemini Advanced

With Google Gemini Advanced, I am using a google sheet to answer questions about the content in the sheet rows. Some of the rows/records contain multiple values. Ex. (corn, pastures, hay, black beans) ...
Lindsey Rex's user avatar
0 votes
0 answers
39 views

Error while converting my .py file to .exe file with pyinstaller

I'm trying to convert my .py file to .exe file with PyInstaller. The .py file, which worked perfectly on Jupyter lab, is not working perfectly in the exe file. This part of the code is causing the ...
조연서's user avatar
1 vote
0 answers
88 views

Mime Type for MS Excel XLSX in VertexAI API

I can successfully process Microsoft Excel XLSX files via the WebUI on GCP (https://console.cloud.google.com/vertex-ai/generative/multimodal/create/text). I can also successfully programmatically pass ...
CoderOfTheNight's user avatar
1 vote
1 answer
2k views

How do I get rid of the annoying terminal warning when using Gemini API?

I followed all the docs for the Gemini API, however, I cannot find anything that solves this issue. https://ai.google.dev/gemini-api/docs/quickstart?lang=python WARNING: All log messages before absl::...
Nathan's user avatar
  • 11
1 vote
2 answers
243 views

How to get JSON output from gemini-1.5-pro-001 using curl

How can I retrieve data in JSON format from the Gemini 1.5 API using curl? The code below works correctly: curl -H 'Content-Type: application/json' -H "x-goog-api-key: ${API_KEY}" ...
kpg's user avatar
  • 7,916
0 votes
0 answers
130 views

ValidationError: 1 validation error for GoogleGenerativeAIEmbeddings model field required (type=value_error.missing)

I am trying to integrate the GoogleGenerativeAIEmbeddings from the langchain_google_genai library into my Streamlit application. However, I am encountering a ValidationError related to missing fields ...
Vivek Raj's user avatar

1
2 3 4 5