Generate Stream

STREAM
GA
POST

Generate a stream of completions using a previously defined deployment.

Note: Uses a base url of https://predict.vellum.ai.

Request

This endpoint expects an object.
requests
list of objectsRequired
The generation request to make. Bulk requests are no longer supported, this field must be an array of length 1.
deployment_id
stringOptional

The ID of the deployment. Must provide either this or deployment_name.

deployment_name
stringOptional

The name of the deployment. Must provide either this or deployment_id.

options
objectOptional
Additional configuration that can be used to control what's included in the response.

Response

This endpoint returns a stream of object
delta
object
POST
$curl -X POST https://predict.vellum.ai/v1/generate-stream \
> -H "X_API_KEY: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "requests": [
> {
> "input_values": {
> "string": {}
> }
> }
> ]
>}'
Response
1{
2 "delta": {
3 "request_index": 0,
4 "data": {
5 "completion_index": 0,
6 "completion": {
7 "id": "string",
8 "external_id": "string",
9 "text": "string",
10 "finish_reason": "LENGTH",
11 "logprobs": {
12 "tokens": [
13 {
14 "token": "string",
15 "logprob": 1,
16 "top_logprobs": {
17 "string": 1
18 },
19 "text_offset": 0
20 }
21 ],
22 "likelihood": 1
23 },
24 "model_version_id": "string",
25 "prompt_version_id": "string",
26 "type": "STRING",
27 "deployment_release_tag": "string",
28 "model_name": "string"
29 }
30 },
31 "error": {
32 "message": "string"
33 }
34 }
35}