output_file_paths to Create Trace, Update Trace or Create and Evaluate Trace instead: it is shorter and does the same upload.
The one thing this method gives you that output_file_paths does not is reuse. Upload a document once and attach the same AttachedFile to many turns, rather than uploading it per turn.
This is the answer-side twin of Upload Input File.
Returns
Returns anAttachedFile with uri, filename and mime_type. Place it in the output’s content list.
The uri still carries the upload’s signature and expires. The API replaces it with the canonical, signature-free reference when the turn is written, so trace.actual_output_files reads back a uri that does not expire and grants nobody the bytes on its own. Never treat either form as a link to the bytes: ask for a fresh one with galtea.storage.download() or galtea.storage.read().
AttachedFile is the object that used to be called InputFile, back when only an input could carry files. The same four fields now describe a file on either side. InputFile still works as a name for it, so code you already wrote keeps running, but it now warns with a GalteaDeprecationWarning. Switch to AttachedFile when you next touch that code.Example
Parameters
string
required
Path to the file on the machine running the SDK. One output accepts at most 20 files, 20 MB in total, and each must be one of these types:
pdf, docx, xlsx, pptx, rtf, png, jpg, jpeg, tiff, tif, bmp, webp, heic, heif, gif, txt, csv, md, html, xml, json, eml. A storage URI is refused: there is nothing on this machine to upload, so attach it directly instead.Related Methods
- Create Trace - Log a turn and attach files in one call
- Update Trace - Attach files to a turn you already logged
- Upload Input File - The same method on the input side