Skip to content

Fix validation errors #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 104 additions & 11 deletions api-spec/openapi-1.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ paths:
- Before importing videos, you must set up an integration. For details, see the [Set up an integration](/docs/upload-cloud#set-up-an-integration) section.
- The videos you wish to upload must meet the requirements in the [Prerequisites](/docs/upload-single-videos#prerequisites) section of the **Upload single videos** page.
- By default, the platform checks for duplicate files using hashes within the target index and will not upload the same video to the same index twice. However, the same video can exist in multiple indexes. To bypass duplicate checking entirely and import duplicate videos into the same index, set the value of the `incremental_import` parameter to `false`.
- Only one import job can run at a time. To start a new import, wait for the current job to complete. Use the [`GET`](/reference/cloud-to-cloud-retrieve-import-logs) method of the `/tasks/transfers/import/{integration-id}/logs` endpoint to retrieve a list of your import jobs, including their creation time, completion time, and processing status for each video file.
parameters:
- $ref: '#/components/parameters/x-api-key'
- $ref: '#/components/parameters/Content-Type'
Expand Down Expand Up @@ -634,7 +635,9 @@ paths:
'429':
description: |
If the rate limit is reached, the platform returns an `HTTP 429 - Too many requests` error response. The response body is empty.
/generate:


'/generate':
post:
summary: Open-ended texts
description: |
Expand All @@ -656,31 +659,117 @@ paths:
description: The specified video has successfully been processed.
headers:
X-Ratelimit-Limit:
$ref: '#/components/headers/X-Ratelimit-Limit'
schema:
type: number
description: The maximum number of requests you can make per rate limit window for this endpoint. For details, see the [Rate limits](/docs/rate-limits) page.
example: 100
X-Ratelimit-Remaining:
$ref: '#/components/headers/X-Ratelimit-Remaining'
schema:
type: number
description: The number of requests remaining in the current rate limit window for the specific endpoint. This value decreases with each request you make to that endpoint and resets at the start of the next rate limit window.
example: 99
X-Ratelimit-Used:
$ref: '#/components/headers/X-Ratelimit-Used'
schema:
type: number
description: The number of requests you have made in the current rate limit window for the specific endpoint. This value increases with each request you make to that endpoint and resets to zero at the start of the next rate limit window.
example: 1
X-Ratelimit-Reset:
$ref: '#/components/headers/X-Ratelimit-Reset'
schema:
type: number
description: The time at which the current rate limit window resets, expressed in UTC epoch seconds. After this time, the values of the `X-Ratelimit-Remaining` and `X-Ratelimit-Used` parameters will be reset to their initial values for the next rate limit window.
example: 1718777276
Transfer-Encoding:
schema:
type: string
description: The platform returns this header when the `stream` parameter is set to `true` in the request. It indicates that the response body is sent in chunks.
description: The platform returns this header when the `stream` parameter is set to `true` in the request. It indicates that the response body is sent in chunks.
default: chunked
example: chunked
content:
application/json:
schema:
oneOf:
- $ref: '#/components/responses/StreamGenerateResponse'
- $ref: '#/components/responses/NonStreamGenerateResponse'
oneOf:
- type: object
description: |
When the value of the `stream` parameter is set to `false`, the response is as follows:
title: Non-streamed response
properties:
id:
description: |
Unique identifier of the response.
type: string
data:
description: |
The generated text based on the prompt you provided.
type: string
- type: object
title: Streamed response
description: |
When the value of the `stream` parameter is set to `true`, the platform provides a streaming response in the NDJSON format.

The stream contains three types of events:
1. Stream start
2. Text generation
3. Stream end

To integrate the response into your application, follow the guidelines below:
- Parse each line of the response as a separate JSON object.
- Check the `event_type` field to determine how to handle the event.
- For `text_generation` events, process the `text` field as it arrives. Depending on your application's requirements, this may involve displaying the text incrementally, storing it for later use, or performing any tasks.
- Use the `stream_start` and `stream_end` events to manage the lifecycle of your streaming session.
oneOf:
- type: object
title: Stream start
description: |
Indicates the beginning of the stream.
properties:
event_type:
type: string
description: |
This field is always set to `stream_start` for this event.
metadata:
type: object
description: An object containing metadata about the stream.
properties:
generation_id:
type: string
description: |
A unique identifier for the generation session.
- type: object
title: Text generation
description: |
Contains a fragment of generated text. Note that text fragments may be split at arbitrary points, not necessarily at word or sentence boundaries.
properties:
event_type:
type: string
description: |
This field is always set to `text_generation` for this event.
text:
type: string
description: |
A fragment of the generated text.
- type: object
title: Stream end
description: |
Indicates the end of the stream.
properties:
event_type:
type: string
description: |
This field is always set to `stream_end` for this event.
metadata:
type: object
description: An object containing metadata about the stream.
properties:
generation_id:
type: string
description: |
The same unique identifier provided in the `stream_start` event.
examples:
non-streaming-response:
summary: Non-streamed response
value:
id: 2a22fd17-7bd4-446a-abd6-b9382cb18f90
data: 1. Vlog\n2. Minnesota\n3. Mall of America\n4. Shopping haul\n5. Outdoor adventure
data: '1. Vlog\n2. Minnesota\n3. Mall of America\n4. Shopping haul\n5. Outdoor adventure'
stream-start-response:
summary: Stream start
value:
Expand All @@ -698,11 +787,15 @@ paths:
event_type: stream_end
metadata:
generation_id: 2f6d0bdd-aed8-47b1-8124-3c9d8006cdc9


'400':
$ref: '#/components/responses/genericError'
$ref: '#/components/responses/genericError'
'429':
description: |
If the rate limit is reached, the platform returns an `HTTP 429 - Too many requests` error response. The response body is empty.


/embed:
post:
summary: Create embeddings for text, image, and audio
Expand Down