Add a Comment to a Log
curl --request POST \
--url https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments \
--header 'Content-Type: application/json' \
--data '
{
"comment": "<string>"
}
'import requests
url = "https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments"
payload = { "comment": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>'})
};
fetch('https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments', 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/{log-id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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/{log-id}/comments"
payload := strings.NewReader("{\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyLogs & Human Feedback
Add a Comment to a Log
POST
/
endpoints
/
{id}
/
logs
/
{log-id}
/
comments
Add a Comment to a Log
curl --request POST \
--url https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments \
--header 'Content-Type: application/json' \
--data '
{
"comment": "<string>"
}
'import requests
url = "https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments"
payload = { "comment": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>'})
};
fetch('https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments', 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/{log-id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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/{log-id}/comments"
payload := strings.NewReader("{\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.baseplate.ai/endpoints/{id}/logs/{log-id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyParameters
Path
String
required
Baseplate endpoint ID
String
The ID of the log/usage. It is returned as βusageldβ in completion requests.
Header
String
Baseplate API key. Needs to be in the format βBearer &BASEPLATE_API_KEYβ
Body
String
The comment to add.
- π’ 200: OK
{
"prompt": "Say this is a test",
"completion": "This is a test.",
"id": "11f96c9a-086c-4490-b330-af0d93c0b322",
"date": "2023-03-13",
"positive_rating": true,
"variant_id": "f04682e5-8bff-48c1-b498-7158d04e72de",
"comments": [
{
"name": "Ani Gottiparthy",
"email": "ani@example",
"comment": "This is a comment from the API",
},
{
"name": "Andrew Luo",
"email": "andrew@example",
"comment": "This is a comment from the API",
}
]
}
βI