zudello-integration-sdk 1.0.9 → 1.0.11
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/package.json +1 -1
- package/src/sdk/Zudello.js +13 -6
package/package.json
CHANGED
package/src/sdk/Zudello.js
CHANGED
|
@@ -166,18 +166,25 @@ class ZudelloSDK extends BaseSDK {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
async ai({ key, body }) {
|
|
169
|
-
const validateIsEmpty = this.validator.isEmpty({ key,
|
|
169
|
+
const validateIsEmpty = this.validator.isEmpty({ key, model, messages });
|
|
170
170
|
|
|
171
171
|
if (!validateIsEmpty.valid) {
|
|
172
172
|
return this.responseHandler.error(validateIsEmpty.errors);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
return await axios.post(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
return await axios.post(
|
|
176
|
+
"https://openrouter.ai/api/v1/chat/completions",
|
|
177
|
+
{
|
|
178
|
+
model,
|
|
179
|
+
messages,
|
|
179
180
|
},
|
|
180
|
-
|
|
181
|
+
{
|
|
182
|
+
headers: {
|
|
183
|
+
Authorization: `Bearer ${key}`,
|
|
184
|
+
"Content-Type": "application/json",
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
);
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
async update({
|