@@ -265,9 +265,19 @@ function getInputMessageContent(
265265 type : 'input_file' ,
266266 } ;
267267 if ( typeof entry . file === 'string' ) {
268- fileEntry . file_data = entry . file ;
269- } else {
268+ if ( entry . file . startsWith ( 'data:' ) ) {
269+ fileEntry . file_data = entry . file ;
270+ } else if ( entry . file . startsWith ( 'https://' ) ) {
271+ fileEntry . file_url = entry . file ;
272+ } else {
273+ throw new UserError (
274+ `Unsupported string data for file input. If you're trying to pass an uploaded file's ID, use an object with the ID property instead.` ,
275+ ) ;
276+ }
277+ } else if ( 'id' in entry . file ) {
270278 fileEntry . file_id = entry . file . id ;
279+ } else if ( 'url' in entry . file ) {
280+ fileEntry . file_url = entry . file . url ;
271281 }
272282 return {
273283 ...fileEntry ,
@@ -525,7 +535,10 @@ function getInputItems(
525535 type : 'code_interpreter_call' ,
526536 id : item . id ! ,
527537 code : item . providerData ?. code ?? '' ,
528- results : item . providerData ?. results ?? [ ] ,
538+ // This property used to be results, so keeping both for backward compatibility
539+ // That said, this property cannot be passed from a user, so it's just API's internal data.
540+ outputs :
541+ item . providerData ?. outputs ?? item . providerData ?. results ?? [ ] ,
529542 status : CodeInterpreterStatus . parse ( item . status ?? 'failed' ) ,
530543 container_id : item . providerData ?. containerId ,
531544 } ;
0 commit comments