cURL
curl --request POST \
--url http://studio.premai.io/api/v1/traces/{id}/addToDataset \
--header 'Authorization: Bearer <token>'import requests
url = "http://studio.premai.io/api/v1/traces/{id}/addToDataset"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://studio.premai.io/api/v1/traces/{id}/addToDataset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"traceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "added",
"success": true,
"datapointId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Traces API
Add Trace to Dataset
Add a trace to a dataset, enabling continuous fine-tuning with fresh, real-world data. If the trace score is above a threshold, a positive datapoint is added; if too low, a new positive datapoint is generated based on user feedback.
POST
/
api
/
v1
/
traces
/
{id}
/
addToDataset
cURL
curl --request POST \
--url http://studio.premai.io/api/v1/traces/{id}/addToDataset \
--header 'Authorization: Bearer <token>'import requests
url = "http://studio.premai.io/api/v1/traces/{id}/addToDataset"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://studio.premai.io/api/v1/traces/{id}/addToDataset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"traceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "added",
"success": true,
"datapointId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
success response
Trace identifier that was processed.
added when the datapoint is stored immediately, queued when generation is in progress, failed when the operation could not start.
Available options:
added, queued, failed true when the action succeeded, false when it failed.
Identifier of the created datapoint when available.
Was this page helpful?