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
The SDK's current version doesn't allow users to request a response in JSON or pass the schema to the API.
Describe the solution you'd like
As a developer using the SDK, I would like to be able to specify the response type as JSON and provide the JSON schema:
var response =await geminiClient.TextPrompt(prompt,new GenerationConfig(){MaxOutputTokens=300,// Feature suggestion: add such property and pass the value to API as `response_mime_type`ResponseMimeType="application/json",// Feature suggestion: add such property and pass the value to API as `response_schema`
ResponseSchema ={ ...// SDK could accept `JObject` or a string containing JSON}});
Describe alternatives you've considered
Currently, I think the only alternative for this use case is to:
not use the SDK,
prepare a plain HTTP request using HttpClient or something similar.
Additional context
Google's documentation for ResponseMimeType and ResponseSchema doesn't contain examples of HTTP requests (only for SDKs in Python, Node, etc.).
I have experimented and provided examples of working requests to enable Gemini's JSON Mode on my blog.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The most recent Gemini 1.5 API allows us to specify the exact JSON schema we expect for the response.
The SDK's current version doesn't allow users to request a response in JSON or pass the schema to the API.
Describe the solution you'd like
As a developer using the SDK, I would like to be able to specify the response type as JSON and provide the JSON schema:
Describe alternatives you've considered
Currently, I think the only alternative for this use case is to:
HttpClient
or something similar.Additional context
Google's documentation for
ResponseMimeType
andResponseSchema
doesn't contain examples of HTTP requests (only for SDKs in Python, Node, etc.).I have experimented and provided examples of working requests to enable Gemini's JSON Mode on my blog.
The text was updated successfully, but these errors were encountered: