Files
dify/web/gen/orpc/api/files.ts
Stephen Zhou 3f7d76d4e2 sort
2026-01-25 20:37:32 +08:00

35 lines
1.8 KiB
TypeScript

// This file is auto-generated by @hey-api/openapi-ts
import { z } from 'zod'
import { zPreviewChatFileData, zPreviewChatFileResponse, zUploadChatFileData, zUploadChatFileResponse } from '../../zod/api/files'
import { base } from '../common'
/**
* File Upload
*
* Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text. Supports png, jpg, jpeg, webp, gif formats. Uploaded files are for use by the current end-user only.
*/
export const uploadChatFileContract = base.route({
method: 'POST',
path: '/files/upload',
operationId: 'uploadChatFile',
summary: 'File Upload',
description: 'Upload a file (currently only images are supported) for use when sending messages, enabling multimodal understanding of images and text. Supports png, jpg, jpeg, webp, gif formats. Uploaded files are for use by the current end-user only.',
tags: ['Files'],
}).input(zUploadChatFileData).output(z.object({ body: zUploadChatFileResponse, status: z.literal(200) }))
/**
* File Preview
*
* Preview or download uploaded files. This endpoint allows you to access files that have been previously uploaded via the File Upload API. Files can only be accessed if they belong to messages within the requesting application.
*/
export const previewChatFileContract = base.route({
method: 'GET',
path: '/files/{file_id}/preview',
operationId: 'previewChatFile',
summary: 'File Preview',
description: 'Preview or download uploaded files. This endpoint allows you to access files that have been previously uploaded via the File Upload API. Files can only be accessed if they belong to messages within the requesting application.',
tags: ['Files'],
}).input(zPreviewChatFileData).output(z.object({ body: zPreviewChatFileResponse, status: z.literal(200) }))