bulltrackers-module 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,14 +28,14 @@ Respond with only one of those three words.
28
28
  Post: "${snippet}"`;
29
29
 
30
30
  try {
31
- // --- START FIX ---
32
- // The request payload was malformed.
33
- // 1. `contents` must have a `parts` array.
34
- // 2. `generationConfig` must be a nested object.
31
+ // --- START FIX: Corrected Request Payload ---
32
+ // The payload must include `role: 'user'` and a `parts` array.
33
+ // Generation settings are nested under `generationConfig`.
35
34
  const request = {
36
35
  contents: [
37
- {
38
- parts: [ { text: prompt } ]
36
+ {
37
+ role: "user",
38
+ parts: [ { text: prompt } ]
39
39
  }
40
40
  ],
41
41
  generationConfig: {
@@ -49,8 +49,9 @@ Post: "${snippet}"`;
49
49
  const result = await geminiModel.generateContent(request);
50
50
  const response = result.response;
51
51
 
52
- // --- START FIX ---
53
- // 3. The response structure is content.parts[0].text, not content[0].text
52
+ // --- START FIX: Corrected Response Parsing ---
53
+ // The text is located at `content.parts[0].text`,
54
+ // not `content[0].text` as in the original file.
54
55
  const text = response?.candidates?.[0]?.content?.parts?.[0]?.text?.trim() || '';
55
56
  // --- END FIX ---
56
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [