List Prompts
POST/prompt-svc/prompts
List prompts that satisfy a query.
Request
- application/json
Body
List Prompts Request
Array [
]
Array [
]
query
object
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.
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.
Possible values: [equals
, containsSubstring
, startsWith
, intersects
, isInList
]
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 the number of records in the result set.
orderBys
object[]
OrderBys order the result set.
Desc indicates whether the sorting should be in descending order.
The field by which to order the results
Randomize indicates that the results should be randomized instead of ordered by the field
and desc
criteria
Responses
- 200
- 400
- 401
- 500
OK
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
prompts
object[]
CreatedAt is the time of the prompt creation.
Error that arose during prompt execution, if any.
Id is the unique ID of the prompt.
LastRun is the time of the last prompt run.
MaxRetries specified how many times the system should retry a prompt when it keeps erroring.
ModelId is just the OpenOrch internal ID of the model.
Prompt is the message itself eg. "What's a banana?
RunCount is the number of times the prompt was retried due to errors
Possible values: [scheduled
, running
, completed
, errored
, abandoned
, canceled
]
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 of the prompt. Optional. If not present it's derived from ModelId.
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 is the last time the prompt was updated.
UserId contains the ID of the user who submitted the prompt.
{
"after": {},
"count": 0,
"prompts": [
{
"createdAt": "string",
"error": "string",
"id": "string",
"lastRun": "string",
"maxRetries": 10,
"modelId": "huggingface/TheBloke/mistral-7b-instruct-v0.2.Q3_K_S.gguf",
"prompt": "What's a banana?",
"runCount": 0,
"status": "scheduled",
"sync": true,
"template": "[INST]{prompt}[/INST]",
"threadId": "string",
"updatedAt": "string",
"userId": "string"
}
]
}
Invalid JSON
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string"
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string"
}