Image input
This commit is contained in:
+55
-1
@@ -318,6 +318,43 @@ paths:
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
"409": { $ref: "#/components/responses/Error" }
|
||||
|
||||
/api/blobs:
|
||||
post:
|
||||
operationId: uploadBlob
|
||||
description: >
|
||||
Stores an image for use in a message. The body is the raw image; its type is detected from the bytes
|
||||
and must be PNG, JPEG, GIF or WebP. At most 5 MiB.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
image/png: { schema: { type: string, format: binary } }
|
||||
image/jpeg: { schema: { type: string, format: binary } }
|
||||
image/gif: { schema: { type: string, format: binary } }
|
||||
image/webp: { schema: { type: string, format: binary } }
|
||||
responses:
|
||||
"201":
|
||||
description: The stored blob.
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "#/components/schemas/Blob" }
|
||||
"400": { $ref: "#/components/responses/Error" }
|
||||
"413": { $ref: "#/components/responses/Error" }
|
||||
|
||||
/api/blobs/{blobId}:
|
||||
parameters:
|
||||
- { name: blobId, in: path, required: true, schema: { type: string } }
|
||||
get:
|
||||
operationId: getBlob
|
||||
responses:
|
||||
"200":
|
||||
description: The blob's bytes, with its content type.
|
||||
content:
|
||||
image/png: { schema: { type: string, format: binary } }
|
||||
image/jpeg: { schema: { type: string, format: binary } }
|
||||
image/gif: { schema: { type: string, format: binary } }
|
||||
image/webp: { schema: { type: string, format: binary } }
|
||||
"404": { $ref: "#/components/responses/Error" }
|
||||
|
||||
/api/inbox:
|
||||
get:
|
||||
operationId: listInbox
|
||||
@@ -537,16 +574,33 @@ components:
|
||||
properties:
|
||||
prompt: { type: string }
|
||||
model: { type: string }
|
||||
images:
|
||||
type: array
|
||||
items: { type: string }
|
||||
description: Blob ids from uploadBlob, sent to the agent as images alongside the prompt.
|
||||
|
||||
MessageCreate:
|
||||
type: object
|
||||
required: [text]
|
||||
properties:
|
||||
text: { type: string }
|
||||
text: { type: string, description: May be empty when images are given. }
|
||||
images:
|
||||
type: array
|
||||
items: { type: string }
|
||||
description: Blob ids from uploadBlob, sent to the agent as images alongside the text.
|
||||
model:
|
||||
type: string
|
||||
description: Model for this turn and later ones. When it differs from the session's model, the session switches before the message is sent.
|
||||
|
||||
Blob:
|
||||
type: object
|
||||
required: [id, content_type, created_by, created_at]
|
||||
properties:
|
||||
id: { type: string }
|
||||
content_type: { type: string }
|
||||
created_by: { type: string }
|
||||
created_at: { type: string, format: date-time }
|
||||
|
||||
Attachment:
|
||||
type: object
|
||||
required: [kind]
|
||||
|
||||
Reference in New Issue
Block a user