Skip to main content

List Prompts

POST 

/prompt-svc/prompts

List prompts that satisfy a query.

Request

Body

List Prompts Request

    query

    object

    count boolean

    Count true means return the count of the dataset filtered by Filters without after or limit.

    filters

    object[]

    Filters are filtering options of a query. It is advised to use It's advised to use helper functions in your respective client library such as filter constructors (all, equal, contains, startsWith) and field selectors (field, fields, id) for easier access.

  • Array [

  • fields string[]
    jsonValues string

    JSONValues is a JSON marshalled array of values. It's JSON marhalled due to the limitations of the Swaggo -> OpenAPI 2.0 -> OpenAPI Go generator toolchain.

    op string

    Possible values: [equals, containsSubstring, startsWith, intersects, isInList]

  • ]

  • jsonAfter string

    JSONAfter is used for cursor-based pagination, which is more effective in scalable and distributed environments compared to offset-based pagination.

    JSONAfter is a JSON encoded string due to limitations of Swaggo (ie. []interface{} generates []map[stirng]interface{}).

    limit integer

    Limit the number of records in the result set.

    orderBys

    object[]

    OrderBys order the result set.

  • Array [

  • desc boolean

    Desc indicates whether the sorting should be in descending order.

    field string

    The field by which to order the results

    randomize boolean

    Randomize indicates that the results should be randomized instead of ordered by the field and desc criteria

  • ]

Responses

OK

Schema

    after
    count integer

    prompts

    object[]

  • Array [

  • 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...