monacopilot 0.13.0 → 0.13.1
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.
- package/README.md +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,12 +85,14 @@ app.post('/complete', async (req, res) => {
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
// Process raw LLM response if needed
|
|
88
|
+
// `raw` can be undefined if an error occurred, which happens when `error` is present
|
|
88
89
|
if (raw) {
|
|
89
90
|
calculateCost(raw.usage.total_tokens);
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
// Handle
|
|
93
|
+
// Handle errors if present
|
|
93
94
|
if (error) {
|
|
95
|
+
console.error('Completion error:', error);
|
|
94
96
|
res.status(500).json({completion: null, error});
|
|
95
97
|
}
|
|
96
98
|
|