-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Description
We encountered an issue when sending an image as part of a message to the Google Gemini 1.5 Flash model using the Braintrust Proxy. The request fails with the following error:
400 Invalid JSON payload received.
Unknown name "text" at 'contents[1].parts[0]': Proto field is not repeating, cannot start list.
Steps to Reproduce:
- Set up the Braintrust Proxy with Google Gemini 1.5 Flash API using the following code snippet:
const client = new OpenAI({
baseURL: "https://api.braintrust.dev/v1/proxy",
apiKey: process.env.BRAINTRUST_API_KEY,
});
const response = await client.chat.completions.create({
model: "gemini-1.5-flash-latest",
messages: [
{ role: "user", content: "What do you think of this image?" },
{ role: "user", content: [{ type: "image_url", image_url: { url: "https://example.com/image.jpg" } }] }
],
});
console.log(response);
- The request fails with the 400 error mentioned above.
Expected Behaviour:
- The message containing the image should be processed successfully by the Gemini 1.5 Flash model via the Braintrust Proxy.
- The API should return a valid response describing the image or engaging with the user prompt accordingly.
Impact:
- This issue blocks us from sending media (specifically images) along with text messages to the Gemini 1.5 model.
- It is affecting the functionality needed for applications involving image and text-based conversation flows.
Metadata
Metadata
Assignees
Labels
No labels