Upload a file to OpenAI for use with other API endpoints.
Allows uploading files that can be used with various OpenAI features, such as search, fine-tuning, or retrieval augmented responses.
type: "io.kestra.plugin.openai.uploadfile"
Upload a file to OpenAI and get its ID for later use.
id: openai_file_upload
namespace: company.team
inputs:
- id: dataFile
type: FILE
tasks:
- id: upload_file
type: io.kestra.plugin.openai.UploadFile
apiKey: "{{ secret('OPENAI_API_KEY') }}"
file: "{{ inputs.dataFile }}"
purpose: "fine-tune"
- id: use_file_id
type: io.kestra.plugin.core.log.Log
message: "Uploaded file ID: {{ outputs.upload_file.fileId }}"
Upload a user data file with description for search purposes
id: openai_search_file
namespace: company.team
inputs:
- id: documentFile
type: FILE
tasks:
- id: upload
type: io.kestra.plugin.openai.UploadFile
apiKey: "{{ secret('OPENAI_API_KEY') }}"
file: "{{ inputs.documentFile }}"
purpose: "search"
description: "Customer knowledge base articles for retrieval"
OpenAI API key
The source file URI
URI of the file containing data to be loaded into OpenAI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}
.
The intended purpose of the uploaded file.
10
The maximum number of seconds to wait for a response.
A unique identifier representing your end-user.
The ID of the uploaded file.