Skip to main content

Add Prompt

POST 

/prompt-svc/prompt

Adds a new prompt to the prompt queue and either waits for the response (if sync is set to true), or returns immediately.

Request

Body

required

Add Prompt Request

    id string

    Id is the unique ID of the prompt.

    maxRetries integer

    MaxRetries specified how many times the system should retry a prompt when it keeps erroring.

    modelId string

    ModelId is just the Singulatron internal ID of the model.

    prompt stringrequired

    Prompt is the message itself eg. "What's a banana?

    sync boolean

    Sync drives whether prompt add request should wait and hang until the prompt is done executing. By default the prompt just gets put on a queue and the client will just subscribe to a Thread Stream. For quick and dirty scripting however it's often times easier to do things syncronously. In those cases set Sync to true.

    template string

    Template of the prompt. Optional. If not present it's derived from ModelId.

    threadId string

    ThreadId is the ID of the thread a prompt belongs to. Clients subscribe to Thread Streams to see the answer to a prompt, or set prompt.sync to true for a blocking answer.

Responses

OK

Schema

    answer string

    prompt

    object

    createdAt string

    CreatedAt is the time of the prompt creation.

    error string

    Error that arose during prompt execution, if any.

    id string

    Id is the unique ID of the prompt.

    lastRun string

    LastRun is the time of the last prompt run.

    maxRetries integer

    MaxRetries specified how many times the system should retry a prompt when it keeps erroring.

    modelId string

    ModelId is just the Singulatron internal ID of the model.

    prompt stringrequired

    Prompt is the message itself eg. "What's a banana?

    runCount integer

    RunCount is the number of times the prompt was retried due to errors

    status string

    Possible values: [scheduled, running, completed, errored, abandoned, canceled]

    sync boolean

    Sync drives whether prompt add request should wait and hang until the prompt is done executing. By default the prompt just gets put on a queue and the client will just subscribe to a Thread Stream. For quick and dirty scripting however it's often times easier to do things syncronously. In those cases set Sync to true.

    template string

    Template of the prompt. Optional. If not present it's derived from ModelId.

    threadId string

    ThreadId is the ID of the thread a prompt belongs to. Clients subscribe to Thread Streams to see the answer to a prompt, or set prompt.sync to true for a blocking answer.

    updatedAt string

    UpdatedAt is the last time the prompt was updated.

    userId string

    UserId contains the ID of the user who submitted the prompt.

Loading...