Updates the Rating for a Completion Log
curl --request PATCH \
--url https://app.baseplate.ai/endpoints/{id}/logs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"logs": [
{}
]
}
'import requests
url = "https://app.baseplate.ai/endpoints/{id}/logs"
payload = { "logs": [{}] }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({logs: [{}]})
};
fetch('https://app.baseplate.ai/endpoints/{id}/logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.baseplate.ai/endpoints/{id}/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'logs' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.baseplate.ai/endpoints/{id}/logs"
payload := strings.NewReader("{\n \"logs\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.baseplate.ai/endpoints/{id}/logs")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"logs\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.baseplate.ai/endpoints/{id}/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"logs\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyLogs & Human Feedback
Updates the Rating for a Completion Log
Updates the rating of a completion using human feedback from your users. If you surface a like/dislike or other rating system, you can track the feedback in Baseplate.
PATCH
/
endpoints
/
{id}
/
logs
Updates the Rating for a Completion Log
curl --request PATCH \
--url https://app.baseplate.ai/endpoints/{id}/logs \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"logs": [
{}
]
}
'import requests
url = "https://app.baseplate.ai/endpoints/{id}/logs"
payload = { "logs": [{}] }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({logs: [{}]})
};
fetch('https://app.baseplate.ai/endpoints/{id}/logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.baseplate.ai/endpoints/{id}/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'logs' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.baseplate.ai/endpoints/{id}/logs"
payload := strings.NewReader("{\n \"logs\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.baseplate.ai/endpoints/{id}/logs")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"logs\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.baseplate.ai/endpoints/{id}/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"logs\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyParameters
Path
string
required
Baseplate endpoint ID
Header
string
required
Baseplate API key. Needs to be in the format “Bearer &BASEPLATE_API_KEY”
string
Use application/json
Body
Array
Array of logs to batch update. Each object should contain a positive_rating
and usage_id. Either “logs” or “positive_rating + “usage_id” is required.
- 🟢 200: OK
- 🟠 401: Unauthorized
{
"user_id": "8f48225a-8d88-48ae-b464-d02051b9b556",
"project_id": "52ab5474-5535-4bba-9d7f-590e1dd0a280",
"timestamp": "2023-02-09T05:11:39.721074+00:00",
"openai_name": "text-davinci-003",
"cost": 0.00078,
"prompt": "Write a product description for Jacket. It is a new product in shoe. The description should have a angry tone.",
"completion": "\n\nThis Jacket is the ultimate in shoe fashion. It's sleek, stylish",
"id": "04bc3dfa-d1a1-4647-8970-f180a06f6bea",
"date": "2023-02-09",
"rating": 0,
"temp": 0,
"completions": null,
"managed": true,
"positive_rating": true,
"template_id": null,
"values": {
"tone": "angry",
"category": "shoe",
"product_name": "Jacket"
}
}
Unauthorized for project or invalid API key.
{
// Response
}
⌘I