AI Servers
This chapter focuses on services for the AI servers.
Get all AI servers
A GET
to /ai-servers
returns all the AI servers.
HTTP request
GET /api/rest/latest/ai-servers HTTP/1.1
Accept: application/json
Host: localhost:8080
Request 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: 2914
{
"_embedded" : {
"ai-servers" : [ {
"id" : 3,
"name" : "first ai server",
"url" : "https://openai.com/",
"description" : "a description of the usage and destination of this server",
"payload_template" : "{\"model\": \"gpt-4-1106-preview\", \"messages\": [{\"role\": \"user\", \"content\": \"You are a manual tester. You must transform a requirement into one or several test cases, written in English. The description of the test case must consist of a sum up of the given requirement. Your answer must have this format : \"{\"testCases\":[{\"name\":\"\",\"description\":\"\",\"prerequisites\":\"\",\"testSteps\":[{\"index\":0,\"action\":\"\",\"expectedResult\":\"\"}]}]\"{{ requirement }}\"}] ,\"temperature\": 0.9, \"top_p\": 0.9, \"n\": 1, \"stream\": false, \"max_tokens\": 2000, \"presence_penalty\": 0, \"frequency_penalty\": 0}",
"json_path" : "choices[0].message.content",
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "TOKEN_AUTH",
"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/ai-servers/3"
}
}
}, {
"id" : 12,
"name" : "second ai server",
"url" : "https://openai.com/",
"description" : "another description so admin knows what he is doing",
"payload_template" : "json you can get in the doc of your provider",
"json_path" : "[42][1984]",
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "TOKEN_AUTH",
"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/ai-servers/12"
}
}
}, {
"id" : 13,
"name" : "third ai server",
"url" : "https://otplol.com/",
"description" : "I think it is clear now",
"payload_template" : "json you can get in the doc of your provider",
"json_path" : "can.also.look.like.this",
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "TOKEN_AUTH",
"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/ai-servers/13"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/ai-servers?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 AI server
A GET
to /ai-servers/{id}
returns the AI server with the given id.
HTTP request
GET /api/rest/latest/ai-servers/3 HTTP/1.1
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the artificial intelligence server |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1265
{
"id" : 3,
"name" : "an ai server",
"url" : "https://api.openai.com/v1/chat/completions",
"description" : "This server should be used for generating test case, link it with projects 2, 4 and 12",
"payload_template" : "{\"model\": \"gpt-4-1106-preview\", \"messages\": [{\"role\": \"user\", \"content\": \"You are a manual tester. You must transform a requirement into one or several test cases, written in English. The description of the test case must consist of a sum up of the given requirement. Your answer must have this format : \"{\"testCases\":[{\"name\":\"\",\"description\":\"\",\"prerequisites\":\"\",\"testSteps\":[{\"index\":0,\"action\":\"\",\"expectedResult\":\"\"}]}]\"{{ requirement }}\"}] ,\"temperature\": 0.9, \"top_p\": 0.9, \"n\": 1, \"stream\": false, \"max_tokens\": 2000, \"presence_penalty\": 0, \"frequency_penalty\": 0}",
"json_path" : "choices[0].message.content",
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "TOKEN_AUTH",
"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/ai-servers/3"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the artificial intelligence server |
|
|
the name of the artificial intelligence server |
|
|
the url of the remote artificial intelligence server |
|
|
the authentication policy of the artificial intelligence server (APP_LEVEL by default) |
|
|
the authentication protocol of the artificial intelligence server (TOKEN_AUTH by default) |
|
|
a pre-formatted payload containing query parameters and a placeholder, designed for submission to an AI service for processing |
|
|
a description of the server |
|
|
a string expression used to navigate and extract specific nodes to access the generated answer in the response |
|
|
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 artificial intelligence server |
Create AI server
A POST
to /ai-servers
creates a new AI server.
HTTP request
POST /api/rest/latest/ai-servers HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 874
Host: localhost:8080
{
"name" : "New Ai Server",
"url" : "https://openai.com/",
"description" : "This server should be used for generating test case, link it with projects 1, 11 and 12",
"payload_template" : "{\"model\": \"gpt-4-1106-preview\", \"messages\": [{\"role\": \"user\", \"content\": \"You are a manual tester. You must transform a requirement into one or several test cases, written in English. The description of the test case must consist of a sum up of the given requirement. Your answer must have this format : \"{\"testCases\":[{\"name\":\"\",\"description\":\"\",\"prerequisites\":\"\",\"testSteps\":[{\"index\":0,\"action\":\"\",\"expectedResult\":\"\"}]}]\"{{ requirement }}\"}] ,\"temperature\": 0.9, \"top_p\": 0.9, \"n\": 1, \"stream\": false, \"max_tokens\": 2000, \"presence_penalty\": 0, \"frequency_penalty\": 0}",
"json_path" : "choices[0].message.content"
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the name of the ai server |
|
|
the url of the ai server |
|
|
a description of the server |
|
|
a pre-formatted payload containing query parameters and a placeholder, designed for submission to an AI service for processing |
|
|
a string expression used to navigate and extract specific nodes to access the generated answer in the response |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1244
{
"id" : 6,
"name" : "New Ai Server",
"url" : "https://openai.com/",
"description" : "This server should be used for generating test case, link it with projects 1, 11 and 12",
"payload_template" : "{\"model\": \"gpt-4-1106-preview\", \"messages\": [{\"role\": \"user\", \"content\": \"You are a manual tester. You must transform a requirement into one or several test cases, written in English. The description of the test case must consist of a sum up of the given requirement. Your answer must have this format : \"{\"testCases\":[{\"name\":\"\",\"description\":\"\",\"prerequisites\":\"\",\"testSteps\":[{\"index\":0,\"action\":\"\",\"expectedResult\":\"\"}]}]\"{{ requirement }}\"}] ,\"temperature\": 0.9, \"top_p\": 0.9, \"n\": 1, \"stream\": false, \"max_tokens\": 2000, \"presence_penalty\": 0, \"frequency_penalty\": 0}",
"json_path" : "choices[0].message.content",
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "TOKEN_AUTH",
"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/ai-servers/6"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the artificial intelligence server |
|
|
the name of the artificial intelligence server |
|
|
the url of the remote artificial intelligence server |
|
|
the authentication policy of the artificial intelligence server APP_LEVEL by default |
|
|
the authentication protocol of the artificial intelligence server TOKEN_AUTH by default |
|
|
a pre-formatted payload containing query parameters and a placeholder, designed for submission to an AI service for processing |
|
|
a description of the server |
|
|
a string expression used to navigate and extract specific nodes to access the generated answer in the response |
|
|
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 ai server |
Modify an AI server
A PATCH
to /ai-servers/{id}
modifies the AI server with the given id.
HTTP request
PATCH /api/rest/latest/ai-servers/4 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 874
Host: localhost:8080
{
"name" : "New Ai Server",
"url" : "https://openai.com/",
"description" : "This server should be used for generating test case, link it with projects 1, 11 and 12",
"payload_template" : "{\"model\": \"gpt-4-1106-preview\", \"messages\": [{\"role\": \"user\", \"content\": \"You are a manual tester. You must transform a requirement into one or several test cases, written in English. The description of the test case must consist of a sum up of the given requirement. Your answer must have this format : \"{\"testCases\":[{\"name\":\"\",\"description\":\"\",\"prerequisites\":\"\",\"testSteps\":[{\"index\":0,\"action\":\"\",\"expectedResult\":\"\"}]}]\"{{ requirement }}\"}] ,\"temperature\": 0.9, \"top_p\": 0.9, \"n\": 1, \"stream\": false, \"max_tokens\": 2000, \"presence_penalty\": 0, \"frequency_penalty\": 0}",
"json_path" : "choices[0].message.content"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the ai server |
Request fields
Path | Type | Description |
---|---|---|
|
|
the name of the ai server |
|
|
the url of the ai server |
|
|
a description of the server |
|
|
a pre-formatted payload containing query parameters and a placeholder, designed for submission to an AI service for processing |
|
|
a string expression used to navigate and extract specific nodes to access the generated answer in the response |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1256
{
"id" : 4,
"name" : "New Name for Ai Server",
"url" : "https://NewAdress.net/",
"description" : "This server should be used for generating test case, link it with projects 1, 11 and 12",
"payload_template" : "{\"model\": \"gpt-4-1106-preview\", \"messages\": [{\"role\": \"user\", \"content\": \"You are a manual tester. You must transform a requirement into one or several test cases, written in English. The description of the test case must consist of a sum up of the given requirement. Your answer must have this format : \"{\"testCases\":[{\"name\":\"\",\"description\":\"\",\"prerequisites\":\"\",\"testSteps\":[{\"index\":0,\"action\":\"\",\"expectedResult\":\"\"}]}]\"{{ requirement }}\"}] ,\"temperature\": 0.9, \"top_p\": 0.9, \"n\": 1, \"stream\": false, \"max_tokens\": 2000, \"presence_penalty\": 0, \"frequency_penalty\": 0}",
"json_path" : "choices[0].message.content",
"authentication_policy" : "APP_LEVEL",
"authentication_protocol" : "TOKEN_AUTH",
"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/ai-servers/4"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the artificial intelligence server |
|
|
the name of the artificial intelligence server |
|
|
the url of the remote artificial intelligence server |
|
|
the authentication policy of the artificial intelligence server (APP_LEVEL by default) |
|
|
the authentication protocol of the artificial intelligence server (TOKEN_AUTH by default) |
|
|
a pre-formatted payload containing query parameters and a placeholder, designed for submission to an AI service for processing |
|
|
a description of the server |
|
|
a string expression used to navigate and extract specific nodes to access the generated answer in the response |
|
|
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 ai server |
Delete AI server
A DELETE
to /ai-servers/{ids}
deletes one or several AI server(s) with the given id(s).
HTTP request
DELETE /api/rest/latest/ai-servers/3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
a list of ids of the ai servers to delete |
HTTP response
HTTP/1.1 204 No Content
Get AI server credentials
A GET
to /ai-servers/{id}/credentials
get the credentials of the AI server with the given id.
HTTP request
GET /api/rest/latest/ai-servers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
the id of the ai server |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 161
{
"_type" : "token-auth-credentials",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/ai-servers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
type of credentials, it can only be token-auth-credentials |
|
|
related links |
Set AI server credentials
A POST
to /ai-server/{id}/credentials
set the credentials of the AI server with the given id.
HTTP request
POST /api/rest/latest/ai-servers/1/credentials HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 76
Host: localhost:8080
{
"_type" : "token-auth-credentials",
"token" : "qEdK6ZEDfEV14BAPiFHE"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the ai server |
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: token-auth-credentials |
|
|
the token to authenticate to this ai server |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 161
{
"_type" : "token-auth-credentials",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/ai-servers/1/credentials"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the credentials: token-auth-credentials |
|
|
related links |