@superinterface/react 3.27.3 → 3.28.0
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.cjs +39 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -14
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +20 -1
- package/dist/types/index.d.ts +20 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44800,8 +44800,7 @@ var Root8 = function(_ref) {
|
|
|
44800
44800
|
var latestMessage = useLatestMessage().latestMessage;
|
|
44801
44801
|
var isDisabled = useMemo13(function() {
|
|
44802
44802
|
var _latestMessage$metada;
|
|
44803
|
-
return(
|
|
44804
|
-
(latestMessage === null || latestMessage === void 0 || (_latestMessage$metada = latestMessage.metadata) === null || _latestMessage$metada === void 0 ? void 0 : _latestMessage$metada.isBlocking) || isDisabledArg);
|
|
44803
|
+
return !!(latestMessage !== null && latestMessage !== void 0 && (_latestMessage$metada = latestMessage.metadata) !== null && _latestMessage$metada !== void 0 && _latestMessage$metada.isBlocking) || !!isDisabledArg;
|
|
44805
44804
|
}, [
|
|
44806
44805
|
latestMessage,
|
|
44807
44806
|
isDisabledArg
|
|
@@ -44811,7 +44810,7 @@ var Root8 = function(_ref) {
|
|
|
44811
44810
|
createMessage: createMessage
|
|
44812
44811
|
}) : /* @__PURE__ */ function() {
|
|
44813
44812
|
var _ref2 = _asyncToGenerator6(function(data2) {
|
|
44814
|
-
var attachments;
|
|
44813
|
+
var attachments, imageFileContentParts;
|
|
44815
44814
|
return _ts_generator(this, function(_state) {
|
|
44816
44815
|
switch(_state.label){
|
|
44817
44816
|
case 0:
|
|
@@ -44826,9 +44825,11 @@ var Root8 = function(_ref) {
|
|
|
44826
44825
|
];
|
|
44827
44826
|
reset();
|
|
44828
44827
|
setFiles([]);
|
|
44829
|
-
attachments = files.
|
|
44828
|
+
attachments = files.filter(function(file_0) {
|
|
44829
|
+
return file_0.purpose === "assistants";
|
|
44830
|
+
}).map(function(file_1) {
|
|
44830
44831
|
return {
|
|
44831
|
-
file_id:
|
|
44832
|
+
file_id: file_1.id,
|
|
44832
44833
|
tools: [
|
|
44833
44834
|
{
|
|
44834
44835
|
type: "file_search"
|
|
@@ -44836,11 +44837,25 @@ var Root8 = function(_ref) {
|
|
|
44836
44837
|
]
|
|
44837
44838
|
};
|
|
44838
44839
|
});
|
|
44840
|
+
imageFileContentParts = files.filter(function(file_2) {
|
|
44841
|
+
return file_2.purpose === "vision";
|
|
44842
|
+
}).map(function(file_3) {
|
|
44843
|
+
return {
|
|
44844
|
+
type: "image_file",
|
|
44845
|
+
image_file: {
|
|
44846
|
+
file_id: file_3.id
|
|
44847
|
+
}
|
|
44848
|
+
};
|
|
44849
|
+
});
|
|
44839
44850
|
return [
|
|
44840
44851
|
4,
|
|
44841
44852
|
createMessage(_objectSpread29({
|
|
44842
|
-
|
|
44843
|
-
|
|
44853
|
+
content: _to_consumable_array(imageFileContentParts).concat([
|
|
44854
|
+
{
|
|
44855
|
+
type: "text",
|
|
44856
|
+
text: data2.content
|
|
44857
|
+
}
|
|
44858
|
+
])
|
|
44844
44859
|
}, attachments.length ? {
|
|
44845
44860
|
attachments: attachments
|
|
44846
44861
|
} : {}))
|
|
@@ -45745,13 +45760,20 @@ function AsyncFromSyncIterator(r) {
|
|
|
45745
45760
|
}
|
|
45746
45761
|
}, new AsyncFromSyncIterator(r);
|
|
45747
45762
|
}
|
|
45748
|
-
var accept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript";
|
|
45763
|
+
var accept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript,\n.png,image/png,\n.jpeg,image/jpeg,\n.jpg,image/jpeg,\n.webp,image/webp,\n.gif,image/gif";
|
|
45764
|
+
var purpose = function(_ref) {
|
|
45765
|
+
var fileObject = _ref.fileObject;
|
|
45766
|
+
if (fileObject.type.startsWith("image/")) {
|
|
45767
|
+
return "vision";
|
|
45768
|
+
}
|
|
45769
|
+
return "assistants";
|
|
45770
|
+
};
|
|
45749
45771
|
var Control2 = function(props) {
|
|
45750
45772
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, setFiles = _useMessageFormContext.setFiles;
|
|
45751
45773
|
var createFile = useCreateFile().createFile;
|
|
45752
45774
|
var addToast = useToasts().addToast;
|
|
45753
45775
|
var onChange = useCallback3(/* @__PURE__ */ function() {
|
|
45754
|
-
var
|
|
45776
|
+
var _ref2 = _asyncToGenerator8(function(event) {
|
|
45755
45777
|
var fileObjects, newFiles, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, err;
|
|
45756
45778
|
return _ts_generator(this, function(_state) {
|
|
45757
45779
|
switch(_state.label){
|
|
@@ -45765,7 +45787,9 @@ var Control2 = function(props) {
|
|
|
45765
45787
|
id: optimisticId(),
|
|
45766
45788
|
filename: fileObject.name,
|
|
45767
45789
|
object: "file",
|
|
45768
|
-
purpose:
|
|
45790
|
+
purpose: purpose({
|
|
45791
|
+
fileObject: fileObject
|
|
45792
|
+
}),
|
|
45769
45793
|
created_at: dayjs2().unix(),
|
|
45770
45794
|
bytes: fileObject.size,
|
|
45771
45795
|
status: "processed",
|
|
@@ -45798,10 +45822,11 @@ var Control2 = function(props) {
|
|
|
45798
45822
|
return [
|
|
45799
45823
|
4,
|
|
45800
45824
|
createFile({
|
|
45801
|
-
file: newFile.fileObject
|
|
45825
|
+
file: newFile.fileObject,
|
|
45826
|
+
purpose: newFile.purpose
|
|
45802
45827
|
}, {
|
|
45803
|
-
onSuccess: function(
|
|
45804
|
-
var file =
|
|
45828
|
+
onSuccess: function(_ref3) {
|
|
45829
|
+
var file = _ref3.file;
|
|
45805
45830
|
return setFiles(function(prev) {
|
|
45806
45831
|
return _to_consumable_array(prev.filter(function(prevFile) {
|
|
45807
45832
|
return prevFile.id !== newFile.id;
|
|
@@ -45911,7 +45936,7 @@ var Control2 = function(props) {
|
|
|
45911
45936
|
});
|
|
45912
45937
|
});
|
|
45913
45938
|
return function(_x) {
|
|
45914
|
-
return
|
|
45939
|
+
return _ref2.apply(this, arguments);
|
|
45915
45940
|
};
|
|
45916
45941
|
}(), [
|
|
45917
45942
|
addToast,
|