gemini-api-php / client

Google Gemini API PHP Client allows you to use the Gemini AI model
MIT License
97 stars 16 forks source link

Add `response_mime_type` support to `generationConfig` #31

Open DrAliRagab opened 3 months ago

DrAliRagab commented 3 months ago

According to google docs here https://ai.google.dev/docs/gemini_api_overview#json We can instruct Gemini to return json by adding "response_mime_type": "application/json" to generationConfig

I hope this will be added to generationConfig

Sinitra commented 2 months ago

+1

Martin-Matchory commented 1 month ago

+1 ... and the corresponding responseSchema please example:

"responseMimeType" => "application/json", "responseSchema" => [ "type" => "ARRAY", "items" => [ "type" => "OBJECT", "properties" => [ "product" => [ "type" => "STRING" ] ] ] ]