Prompt sets
This chapter focuses on services for the prompt sets.
Get all prompt sets
A GET to /prompt-sets returns all the prompt sets.
HTTP request
GET /api/rest/latest/prompt-sets HTTP/1.1
Accept: application/json
Host: localhost:8080
Query parameters
| Parameter | Description |
|---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
|
which type of the element should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1943
{
"_embedded" : {
"prompt-sets" : [ {
"_type" : "prompt-set",
"id" : 3,
"name" : "First prompt set",
"description" : "Description of the first prompt set",
"ai_usage" : {
"id" : 1,
"usage" : "CLASSIC_TEST_CASE_GENERATION"
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/3"
}
}
}, {
"_type" : "prompt-set",
"id" : 4,
"name" : "Second prompt set",
"description" : "Description of the second prompt set",
"ai_usage" : {
"id" : 1,
"usage" : "CLASSIC_TEST_CASE_GENERATION"
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/4"
}
}
}, {
"_type" : "prompt-set",
"id" : 5,
"name" : "Third prompt set",
"description" : "Description of the third prompt set",
"ai_usage" : {
"id" : 1,
"usage" : "CLASSIC_TEST_CASE_GENERATION"
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/5"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 3,
"totalPages" : 1,
"number" : 0
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
| Relation | Description |
|---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Get prompt set
A GET to /prompt-sets/{id} returns the prompt set with the given id.
HTTP request
GET /api/rest/latest/prompt-sets/3 HTTP/1.1
Accept: application/json
Host: localhost:8080
Path parameters
| Parameter | Description |
|---|---|
|
the id of the prompt set |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 820
{
"_type" : "prompt-set",
"id" : 3,
"name" : "Testing prompt set",
"description" : "This prompt set will be used for testing purposes",
"ai_usage" : {
"id" : 1,
"usage" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompts" : [ {
"_type" : "prompt",
"id" : 1,
"name" : "First prompt",
"system_prompt_template" : "A system prompt template",
"user_prompt_template" : "A user prompt template",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompts/1"
}
}
} ],
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/3"
}
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the type of the entity |
|
|
the id of the prompt set |
|
|
the name of the prompt set |
|
|
the description of the prompt set |
|
|
the artificial intelligence usage of the prompt set in SquashTM |
|
|
the prompts of the prompt set |
|
|
user who created the entity |
|
|
timestamp of the creation (ISO 8601) |
|
|
user who modified the entity the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
related links |
Links
| Relation | Description |
|---|---|
|
link to this prompt set |
Create prompt set
A POST to /prompt-sets creates a new prompt set.
HTTP request
POST /api/rest/latest/prompt-sets HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 133
Host: localhost:8080
{
"name" : "New prompt set",
"description" : "Description of the new prompt set",
"ai_usage" : "CLASSIC_TEST_CASE_GENERATION"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the name of the prompt set |
|
|
the description of the prompt set |
|
|
the artificial intelligence usage of the prompt set in SquashTM |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 479
{
"_type" : "prompt-set",
"id" : 6,
"name" : "New prompt set",
"description" : "Description of the new prompt set",
"ai_usage" : {
"id" : 1,
"usage" : "CLASSIC_TEST_CASE_GENERATION"
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/6"
}
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the type of the entity |
|
|
the id of the prompt set |
|
|
the name of the prompt set |
|
|
the description of the prompt set |
|
|
the artificial intelligence usage of the prompt set in SquashTM |
|
|
user who created the entity |
|
|
timestamp of the creation (ISO 8601) |
|
|
user who modified the entity the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
related links |
Links
| Relation | Description |
|---|---|
|
link to this prompt set |
Modify a prompt-set
A PATCH to /prompt-sets/{id} modifies the prompt set with the given id.
HTTP request
PATCH /api/rest/latest/prompt-sets/4 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 96
Host: localhost:8080
{
"name" : "A renamed prompt set",
"description" : "Updated description of the prompt set"
}
Path parameters
| Parameter | Description |
|---|---|
|
the id of the prompt set |
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the name of the prompt set |
|
|
the description of the prompt set |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 508
{
"_type" : "prompt-set",
"id" : 4,
"name" : "A renamed prompt set",
"description" : "Updated description of the prompt set",
"ai_usage" : {
"id" : 1,
"usage" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompts" : [ ],
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/4"
}
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the type of the entity |
|
|
the id of the prompt set |
|
|
the name of the prompt set |
|
|
the description of the prompt set |
|
|
the artificial intelligence usage of the prompt set in SquashTM |
|
|
the prompts of the prompt set |
|
|
user who created the entity |
|
|
timestamp of the creation (ISO 8601) |
|
|
user who modified the entity the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
related links |
Links
| Relation | Description |
|---|---|
|
link to this prompt set |
Delete prompt set
A DELETE to /prompt-sets/{ids} deletes one or several prompt set(s) with the given id(s).
HTTP request
DELETE /api/rest/latest/prompt-sets/3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
| Parameter | Description |
|---|---|
|
list of prompt set IDs to delete |
HTTP response
HTTP/1.1 204 No Content