zudello-integration-sdk 1.0.7 → 1.0.9
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 +16 -1
package/package.json
CHANGED
package/src/sdk/Zudello.js
CHANGED
|
@@ -162,7 +162,22 @@ class ZudelloSDK extends BaseSDK {
|
|
|
162
162
|
|
|
163
163
|
const response = await this.getFileAttachment({ uuid, type });
|
|
164
164
|
|
|
165
|
-
return await axios.get(response.data
|
|
165
|
+
return await axios.get(response.data);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async ai({ key, body }) {
|
|
169
|
+
const validateIsEmpty = this.validator.isEmpty({ key, body });
|
|
170
|
+
|
|
171
|
+
if (!validateIsEmpty.valid) {
|
|
172
|
+
return this.responseHandler.error(validateIsEmpty.errors);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return await axios.post("https://openrouter.ai/api/v1/chat/completions", body, {
|
|
176
|
+
headers: {
|
|
177
|
+
Authorization: `Bearer ${key}`,
|
|
178
|
+
"Content-Type": "application/json",
|
|
179
|
+
},
|
|
180
|
+
});
|
|
166
181
|
}
|
|
167
182
|
|
|
168
183
|
async update({
|