@alpic80/rivet-ai-sdk-provider 2.0.7 → 2.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/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -823,6 +823,13 @@ function convertToRivetChatMessages(prompt) {
|
|
|
823
823
|
functionality: "Invalid images mediaType"
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
|
+
} else if (part.mediaType === "application/pdf") {
|
|
827
|
+
return {
|
|
828
|
+
type: "file",
|
|
829
|
+
filename: part.filename || "file.pdf",
|
|
830
|
+
mediaType: "application/pdf",
|
|
831
|
+
data: part.data.toString()
|
|
832
|
+
};
|
|
826
833
|
} else {
|
|
827
834
|
throw new UnsupportedFunctionalityError({
|
|
828
835
|
functionality: "Only images and PDF file parts are supported"
|
|
@@ -1135,7 +1142,7 @@ prepare tools input:${printObject(tools)}`);
|
|
|
1135
1142
|
}
|
|
1136
1143
|
|
|
1137
1144
|
// src/version.ts
|
|
1138
|
-
var VERSION = true ? "2.0.
|
|
1145
|
+
var VERSION = true ? "2.0.9" : "0.0.0-test";
|
|
1139
1146
|
|
|
1140
1147
|
// src/post-to-api.ts
|
|
1141
1148
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -1428,6 +1435,7 @@ var RivetChatLanguageModel = class {
|
|
|
1428
1435
|
abortSignal: options.abortSignal,
|
|
1429
1436
|
fetch: this.config.fetch
|
|
1430
1437
|
});
|
|
1438
|
+
debugLog(`generate response:${printObject(response)}`);
|
|
1431
1439
|
const choice = response.choices[0];
|
|
1432
1440
|
if (!choice) {
|
|
1433
1441
|
throw new Error("No choices found");
|
|
@@ -1462,6 +1470,7 @@ var RivetChatLanguageModel = class {
|
|
|
1462
1470
|
});
|
|
1463
1471
|
}
|
|
1464
1472
|
}
|
|
1473
|
+
debugLog(`generate content:${printObject(content)}`);
|
|
1465
1474
|
return {
|
|
1466
1475
|
content,
|
|
1467
1476
|
finishReason: mapRivetFinishReason(choice.finish_reason),
|