@saltcorn/large-language-model 0.3.3 → 0.3.4
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/generate.js +7 -1
- package/package.json +1 -1
package/generate.js
CHANGED
|
@@ -127,8 +127,14 @@ const getCompletionOpenAICompatible = async (
|
|
|
127
127
|
body: JSON.stringify(body),
|
|
128
128
|
});
|
|
129
129
|
const results = await rawResponse.json();
|
|
130
|
+
//console.log(JSON.stringify(results, null, 2));
|
|
130
131
|
|
|
131
|
-
return
|
|
132
|
+
return (
|
|
133
|
+
results?.choices?.[0]?.message?.content ||
|
|
134
|
+
(results?.choices?.[0]?.message?.tool_calls
|
|
135
|
+
? { tool_calls: results?.choices?.[0]?.message?.tool_calls }
|
|
136
|
+
: null)
|
|
137
|
+
);
|
|
132
138
|
};
|
|
133
139
|
|
|
134
140
|
const getEmbeddingOpenAICompatible = async (config, { prompt, model }) => {
|