File tree 1 file changed +16
-16
lines changed
packages/Webkul/Admin/src/Helpers
1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,11 @@ private static function sendGeminiRequest($prompt, $model)
70
70
$ url = "https://generativelanguage.googleapis.com/v1beta/models/ {$ model }:generateContent?key= {$ apiKey }" ;
71
71
72
72
$ data = [
73
- " contents " => [
73
+ ' contents ' => [
74
74
[
75
- " parts " => [
75
+ ' parts ' => [
76
76
[
77
- " text " => 'You are an AI assistant. You have to extract the data from the PDF file.
77
+ ' text ' => 'You are an AI assistant. You have to extract the data from the PDF file.
78
78
Example Output:
79
79
{
80
80
"status": 1,
@@ -94,24 +94,24 @@ private static function sendGeminiRequest($prompt, $model)
94
94
"lead_value": 0,
95
95
"source": "AI Extracted"
96
96
}
97
- Note: Only return the output, Do not return or add any comments. '
98
- ]
97
+ Note: Only return the output, Do not return or add any comments. ',
98
+ ],
99
99
],
100
- " role " => " system "
100
+ ' role ' => ' system ' ,
101
101
],
102
102
[
103
- " parts " => [
104
- [" text " => "PDF: \n$ prompt " ]
103
+ ' parts ' => [
104
+ [' text ' => "PDF: \n$ prompt " ],
105
105
],
106
- "role " => "user "
107
- ]
106
+ 'role ' => 'user ' ,
107
+ ],
108
+ ],
109
+ 'generationConfig ' => [
110
+ 'temperature ' => 0.2 ,
111
+ 'topK ' => 30 ,
112
+ 'topP ' => 0.8 ,
113
+ 'maxOutputTokens ' => 512 ,
108
114
],
109
- "generationConfig " => [
110
- "temperature " => 0.2 ,
111
- "topK " => 30 ,
112
- "topP " => 0.8 ,
113
- "maxOutputTokens " => 512
114
- ]
115
115
];
116
116
117
117
return self ::makeCurlRequest ($ url , $ model , $ data );
You can’t perform that action at this time.
0 commit comments