@saltcorn/large-language-model 0.3.4 → 0.3.5

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.
Files changed (2) hide show
  1. package/generate.js +3 -2
  2. package/package.json +1 -1
package/generate.js CHANGED
@@ -100,7 +100,7 @@ const getCompletion = async (config, opts) => {
100
100
 
101
101
  const getCompletionOpenAICompatible = async (
102
102
  { chatCompleteEndpoint, bearer, model },
103
- { systemPrompt, prompt, temperature, chat = [], ...rest }
103
+ { systemPrompt, prompt, temperature, debugResult, chat = [], ...rest }
104
104
  ) => {
105
105
  const headers = {
106
106
  "Content-Type": "application/json",
@@ -127,7 +127,8 @@ 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
+ if (debugResult)
131
+ console.log("OpenAI response", JSON.stringify(results, null, 2));
131
132
 
132
133
  return (
133
134
  results?.choices?.[0]?.message?.content ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/large-language-model",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Large language models and functionality for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {