Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Support responseMimeType for Gemini (aka JSON mode?) #2962

Closed
Manouchehri opened this issue Apr 11, 2024 · 1 comment · Fixed by #2964
Closed

[Feature]: Support responseMimeType for Gemini (aka JSON mode?) #2962

Manouchehri opened this issue Apr 11, 2024 · 1 comment · Fixed by #2964
Assignees
Labels
enhancement New feature or request

Comments

@Manouchehri
Copy link
Collaborator

The Feature

https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini

Motivation, pitch

Basically, translating response_format={"type": "json_object"} for Gemini 1.5 Pro.

Twitter / LinkedIn details

https://www.linkedin.com/in/davidmanouchehri/

@Manouchehri Manouchehri added the enhancement New feature or request label Apr 11, 2024
@Manouchehri Manouchehri self-assigned this Apr 11, 2024
@Manouchehri
Copy link
Collaborator Author

Notes for future David:

curl -X POST "https://us-east4-aiplatform.googleapis.com/v1/projects/litellm-epic/locations/us-east4/publishers/google/models/gemini-1.5-pro-preview-0409:generateContent" \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H 'Content-Type: application/json' \
    -d '{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "tell me a joke"
                }
            ]
        }
    ],
    "safety_settings": [
      {
        "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
        "threshold": "BLOCK_LOW_AND_ABOVE"
      }
    ],
    "generation_config": {
      "max_output_tokens": 256,
      "response_mime_type": "application/json"
    }
}' -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant