@saltcorn/large-language-model 0.5.0 → 0.5.2

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 +19 -2
  2. package/package.json +1 -1
package/generate.js CHANGED
@@ -120,7 +120,16 @@ const getCompletion = async (config, opts) => {
120
120
 
121
121
  const getCompletionOpenAICompatible = async (
122
122
  { chatCompleteEndpoint, bearer, apiKey, model },
123
- { systemPrompt, prompt, temperature, debugResult, chat = [], ...rest }
123
+ {
124
+ systemPrompt,
125
+ prompt,
126
+ temperature,
127
+ debugResult,
128
+ chat = [],
129
+ api_key,
130
+ endpoint,
131
+ ...rest
132
+ }
124
133
  ) => {
125
134
  const headers = {
126
135
  "Content-Type": "application/json",
@@ -142,7 +151,15 @@ const getCompletionOpenAICompatible = async (
142
151
  temperature: temperature || 0.7,
143
152
  ...rest,
144
153
  };
145
- if (debugResult) console.log("OpenAI request", JSON.stringify(body, null, 2));
154
+ if (debugResult)
155
+ console.log(
156
+ "OpenAI request",
157
+ JSON.stringify(body, null, 2),
158
+ "to",
159
+ chatCompleteEndpoint,
160
+ "headers",
161
+ JSON.stringify(headers)
162
+ );
146
163
  const rawResponse = await fetch(chatCompleteEndpoint, {
147
164
  method: "POST",
148
165
  headers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/large-language-model",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Large language models and functionality for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {