AI Analysis: simplify Gemini request to fix payload errors
This commit is contained in:
@@ -197,10 +197,7 @@ class AIAnalysisService
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$response = Http::timeout(60)->post("https://generativelanguage.googleapis.com/v1/models/gemini-1.5-flash:generateContent?key=" . $apiKey, [
|
$response = Http::timeout(60)->post("https://generativelanguage.googleapis.com/v1/models/gemini-1.5-flash:generateContent?key=" . $apiKey, [
|
||||||
'contents' => [['parts' => [['text' => $prompt]]]],
|
'contents' => [['parts' => [['text' => $prompt]]]]
|
||||||
'generation_config' => [
|
|
||||||
'response_mime_type' => 'application/json'
|
|
||||||
]
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($response->successful()) {
|
if ($response->successful()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user