File Input¶
file-input is a small model-backed graph for trying native Responses
input_file parts end to end. It reads each central file_id, downloads the
original bytes, and sends them to the configured OpenAI Responses API. It has
no graph persistence.
LangGraph Topology¶
graph TD;
__start__ --> process_files;
process_files --> __end__;
Request Flow¶
- Chainlit and Open WebUI upload the current attachments through their
configured
/v1/filesroute to the central demo Files service, then place the returned IDs in the user message. - LGOS preserves those native
filecontent parts in the LangChainHumanMessage. - The graph retrieves the filename and bytes from
DEMO_API_FILES_BASE_URL. - Images become inline
input_imagedata URLs. Other files become inlineinput_filedata URLs with their original filename. - The graph calls
responses.createand returnsresponse.output_textas the assistant message.
The Responses API accepts Base64 data in input_file items. Supported parsing
depends on the file type; see the official OpenAI
file input guide.
sequenceDiagram
participant UI as Chainlit / Open WebUI
box LGOS API process
participant API as /v1/responses
participant Graph as file-input graph
end
participant Files as Central Files API
participant Model as Upstream Responses API
UI->>Files: POST /v1/files
Files-->>UI: file_id
UI->>API: Responses input with file_id
API->>Graph: LangChain file content parts
Graph->>Files: GET metadata and content
Files-->>Graph: Filename and bytes
Graph->>Model: Inline input_file or input_image
Model-->>Graph: output_text
Graph-->>API: Assistant message
API-->>UI: Assistant text
Try It¶
Run either maintained Compose UI, select file-input, attach a supported
document or image, and send a request such as:
The demo downloads and forwards the entire attachment for each request. It is
therefore intended for small files, not retrieval over a large corpus. The
central file_id is only a reference, not authorization; production services
must enforce file access and retention at their own boundary.