Skip to content

gemini completion doesn't handle message contents as a list #433

@daavoo

Description

@daavoo

OpenAI API supports the following format (https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages-user-message-content):

messages=[
    {
        "role": "user", 
        "content":  {
            "type": "text",
            "text": "HELLO!"
        }
    }
]

But our current gemini implementation doesn't handle it correctly and fails at:

parts = [types.Part.from_text(text=message["content"])]

Apart from being a bug today for text type, this a prerequisite for #415

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions