File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
client/src/components/Chat/Input/Files Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -931,6 +931,24 @@ class BaseClient {
931
931
continue ;
932
932
}
933
933
934
+ if ( item . type === 'tool_call' && item . tool_call != null ) {
935
+ const toolName = item . tool_call ?. name || '' ;
936
+ if ( toolName != null && toolName && typeof toolName === 'string' ) {
937
+ numTokens += this . getTokenCount ( toolName ) ;
938
+ }
939
+
940
+ const args = item . tool_call ?. args || '' ;
941
+ if ( args != null && args && typeof args === 'string' ) {
942
+ numTokens += this . getTokenCount ( args ) ;
943
+ }
944
+
945
+ const output = item . tool_call ?. output || '' ;
946
+ if ( output != null && output && typeof output === 'string' ) {
947
+ numTokens += this . getTokenCount ( output ) ;
948
+ }
949
+ continue ;
950
+ }
951
+
934
952
const nestedValue = item [ item . type ] ;
935
953
936
954
if ( ! nestedValue ) {
Original file line number Diff line number Diff line change @@ -113,21 +113,23 @@ async function importLibreChatConvo(
113
113
*/
114
114
const traverseMessages = async ( messages , parentMessageId = null ) => {
115
115
for ( const message of messages ) {
116
- if ( ! message . text ) {
116
+ if ( ! message . text && ! message . content ) {
117
117
continue ;
118
118
}
119
119
120
120
let savedMessage ;
121
121
if ( message . sender ?. toLowerCase ( ) === 'user' || message . isCreatedByUser ) {
122
122
savedMessage = await importBatchBuilder . saveMessage ( {
123
123
text : message . text ,
124
+ content : message . content ,
124
125
sender : 'user' ,
125
126
isCreatedByUser : true ,
126
127
parentMessageId : parentMessageId ,
127
128
} ) ;
128
129
} else {
129
130
savedMessage = await importBatchBuilder . saveMessage ( {
130
131
text : message . text ,
132
+ content : message . content ,
131
133
sender : message . sender ,
132
134
isCreatedByUser : false ,
133
135
model : options . model ,
Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ const FilePreview = ({
21
21
} ) => {
22
22
const radius = 55 ; // Radius of the SVG circle
23
23
const circumference = 2 * Math . PI * radius ;
24
- const progress = useProgress ( file ?. [ 'progress' ] ?? 1 , 0.001 , ( file as ExtendedFile ) . size ?? 1 ) ;
24
+ const progress = useProgress (
25
+ file ?. [ 'progress' ] ?? 1 ,
26
+ 0.001 ,
27
+ ( file as ExtendedFile | undefined ) ?. size ?? 1 ,
28
+ ) ;
25
29
26
30
// Calculate the offset based on the loading progress
27
31
const offset = circumference - progress * circumference ;
You canāt perform that action at this time.
0 commit comments