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: 2295
{
"_embedded" : {
"prompt-sets" : [ {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/3"
}
},
"_type" : "prompt-set",
"id" : 3,
"name" : "First prompt set",
"description" : "Description of the first prompt set",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "INSTANCE",
"owner_project" : null,
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/4"
}
},
"_type" : "prompt-set",
"id" : 4,
"name" : "Second prompt set",
"description" : "Description of the second prompt set",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "INSTANCE",
"owner_project" : null,
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/5"
}
},
"_type" : "prompt-set",
"id" : 5,
"name" : "Third prompt set",
"description" : "Description of the third prompt set",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "PROJECT",
"owner_project" : {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/1"
}
},
"_type" : "project",
"id" : 1
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets?page=0&size=20"
}
},
"page" : {
"number" : 0,
"size" : 20,
"totalElements" : 3,
"totalPages" : 1
}
}
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: 930
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/3"
}
},
"_type" : "prompt-set",
"id" : 3,
"name" : "Testing prompt set",
"description" : "This prompt set will be used for testing purposes",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "INSTANCE",
"owner_project" : null,
"prompts" : [ {
"_type" : "prompt",
"id" : 1,
"name" : "First prompt",
"system_prompt_template" : "A system prompt template",
"user_prompt_template" : "A user prompt template",
"context_wrapper_template" : "A context wrapper template",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompts/1"
}
}
} ],
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
}
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 use of the prompt set in SquashTM |
|
|
the level of the prompt set, 'SYSTEM' indicates a pre-configured and protected prompt set while 'INSTANCE' indicates an instance-level prompt set created by an administrator. 'PROJECT' indicates a project-level prompt set created by an administrator or a project manager. |
|
|
the project to which the prompt set belongs |
|
|
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: 151
Host: localhost:8080
{
"name" : "New prompt set",
"description" : "Description of the new prompt set",
"ai_use" : "CLASSIC_TEST_CASE_GENERATION",
"project_id" : 1
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the name of the prompt set |
|
|
the description of the prompt set |
|
|
the artificial intelligence use of the prompt set in SquashTM |
|
|
the id of the project in which to create the prompt set (optional) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 681
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/6"
}
},
"_type" : "prompt-set",
"id" : 6,
"name" : "New prompt set",
"description" : "Description of the new prompt set",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "PROJECT",
"owner_project" : {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/1"
}
},
"_type" : "project",
"id" : 1
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
}
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 use of the prompt set in SquashTM |
|
|
the level of the prompt set, 'SYSTEM' indicates a pre-configured and protected prompt set while 'INSTANCE' indicates an instance-level prompt set created by an administrator. 'PROJECT' indicates a project-level prompt set created by an administrator or a project manager. |
|
|
the project to which the prompt set belongs |
|
|
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: 555
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/4"
}
},
"_type" : "prompt-set",
"id" : 4,
"name" : "A renamed prompt set",
"description" : "Updated description of the prompt set",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "INSTANCE",
"owner_project" : null,
"prompts" : [ ],
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
}
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 use of the prompt set in SquashTM |
|
|
the level of the prompt set, 'SYSTEM' indicates a pre-configured and protected prompt set while 'INSTANCE' indicates an instance-level prompt set created by an administrator. 'PROJECT' indicates a project-level prompt set created by an administrator or a project manager. |
|
|
the project to which the prompt set belongs |
|
|
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 |
Duplicate prompt set
A POST to /prompt-sets/{id}/duplicate creates a copy of the prompt set with the given id.
HTTP request
POST /api/rest/latest/prompt-sets/3/duplicate HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 22
Host: localhost:8080
{
"project_id" : 1
}
Path parameters
| Parameter | Description |
|---|---|
|
the id of the source prompt set to duplicate |
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the id of the target project in which to create the duplicated prompt set (optional - if omitted, creates an instance-level copy) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 691
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/prompt-sets/7"
}
},
"_type" : "prompt-set",
"id" : 7,
"name" : "First prompt set Copy1",
"description" : "Description of the first prompt set",
"ai_use" : {
"id" : 1,
"use" : "CLASSIC_TEST_CASE_GENERATION"
},
"prompt_set_level" : "PROJECT",
"owner_project" : {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/1"
}
},
"_type" : "project",
"id" : 1
},
"created_by" : "admin",
"created_on" : "2020-04-06T10:00:00.000Z",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-06T10:00:00.000Z"
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the type of the entity |
|
|
the id of the duplicated prompt set |
|
|
the name of the duplicated prompt set |
|
|
the description of the duplicated prompt set |
|
|
the artificial intelligence use of the prompt set in SquashTM |
|
|
the level of the prompt set, 'SYSTEM' indicates a pre-configured and protected prompt set while 'INSTANCE' indicates an instance-level prompt set created by an administrator. 'PROJECT' indicates a project-level prompt set created by an administrator or a project manager. |
|
|
the project to which the duplicated prompt set belongs |
|
|
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 duplicated 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