Passer au contenu principal
POST
/
feedback
/
replace
Remplacement de feedback
curl --request POST \
  --url https://api.example.com/feedback/replace \
  --header 'Content-Type: application/json' \
  --data '
{
  "feedback_id": "<string>",
  "feedback_type": "<string>",
  "payload": {},
  "project_id": "<string>",
  "weave_ref": "<string>",
  "annotation_ref": "weave:///entity/project/object/name:digest",
  "call_ref": "weave:///entity/project/call/call_id",
  "creator": "Jane Smith",
  "id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
  "queue_id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
  "runnable_ref": "weave:///entity/project/op/name:digest",
  "scorer_rating_confidences": {},
  "scorer_rating_reasons": {},
  "scorer_ratings": {},
  "scorer_tag_confidences": {},
  "scorer_tag_reasons": {},
  "scorer_tags": [
    "<string>"
  ],
  "span_agent_name": "",
  "span_agent_version": "",
  "span_status_code": "UNSET",
  "trigger_ref": "weave:///entity/project/object/name:digest",
  "wb_user_id": "<string>"
}
'
import requests

url = "https://api.example.com/feedback/replace"

payload = {
"feedback_id": "<string>",
"feedback_type": "<string>",
"payload": {},
"project_id": "<string>",
"weave_ref": "<string>",
"annotation_ref": "weave:///entity/project/object/name:digest",
"call_ref": "weave:///entity/project/call/call_id",
"creator": "Jane Smith",
"id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
"queue_id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
"runnable_ref": "weave:///entity/project/op/name:digest",
"scorer_rating_confidences": {},
"scorer_rating_reasons": {},
"scorer_ratings": {},
"scorer_tag_confidences": {},
"scorer_tag_reasons": {},
"scorer_tags": ["<string>"],
"span_agent_name": "",
"span_agent_version": "",
"span_status_code": "UNSET",
"trigger_ref": "weave:///entity/project/object/name:digest",
"wb_user_id": "<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({
feedback_id: '<string>',
feedback_type: '<string>',
payload: {},
project_id: '<string>',
weave_ref: '<string>',
annotation_ref: 'weave:///entity/project/object/name:digest',
call_ref: 'weave:///entity/project/call/call_id',
creator: 'Jane Smith',
id: '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
queue_id: '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
runnable_ref: 'weave:///entity/project/op/name:digest',
scorer_rating_confidences: {},
scorer_rating_reasons: {},
scorer_ratings: {},
scorer_tag_confidences: {},
scorer_tag_reasons: {},
scorer_tags: ['<string>'],
span_agent_name: '',
span_agent_version: '',
span_status_code: 'UNSET',
trigger_ref: 'weave:///entity/project/object/name:digest',
wb_user_id: '<string>'
})
};

fetch('https://api.example.com/feedback/replace', 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://api.example.com/feedback/replace",
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([
'feedback_id' => '<string>',
'feedback_type' => '<string>',
'payload' => [

],
'project_id' => '<string>',
'weave_ref' => '<string>',
'annotation_ref' => 'weave:///entity/project/object/name:digest',
'call_ref' => 'weave:///entity/project/call/call_id',
'creator' => 'Jane Smith',
'id' => '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
'queue_id' => '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
'runnable_ref' => 'weave:///entity/project/op/name:digest',
'scorer_rating_confidences' => [

],
'scorer_rating_reasons' => [

],
'scorer_ratings' => [

],
'scorer_tag_confidences' => [

],
'scorer_tag_reasons' => [

],
'scorer_tags' => [
'<string>'
],
'span_agent_name' => '',
'span_agent_version' => '',
'span_status_code' => 'UNSET',
'trigger_ref' => 'weave:///entity/project/object/name:digest',
'wb_user_id' => '<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://api.example.com/feedback/replace"

payload := strings.NewReader("{\n \"feedback_id\": \"<string>\",\n \"feedback_type\": \"<string>\",\n \"payload\": {},\n \"project_id\": \"<string>\",\n \"weave_ref\": \"<string>\",\n \"annotation_ref\": \"weave:///entity/project/object/name:digest\",\n \"call_ref\": \"weave:///entity/project/call/call_id\",\n \"creator\": \"Jane Smith\",\n \"id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"queue_id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"runnable_ref\": \"weave:///entity/project/op/name:digest\",\n \"scorer_rating_confidences\": {},\n \"scorer_rating_reasons\": {},\n \"scorer_ratings\": {},\n \"scorer_tag_confidences\": {},\n \"scorer_tag_reasons\": {},\n \"scorer_tags\": [\n \"<string>\"\n ],\n \"span_agent_name\": \"\",\n \"span_agent_version\": \"\",\n \"span_status_code\": \"UNSET\",\n \"trigger_ref\": \"weave:///entity/project/object/name:digest\",\n \"wb_user_id\": \"<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://api.example.com/feedback/replace")
.header("Content-Type", "application/json")
.body("{\n \"feedback_id\": \"<string>\",\n \"feedback_type\": \"<string>\",\n \"payload\": {},\n \"project_id\": \"<string>\",\n \"weave_ref\": \"<string>\",\n \"annotation_ref\": \"weave:///entity/project/object/name:digest\",\n \"call_ref\": \"weave:///entity/project/call/call_id\",\n \"creator\": \"Jane Smith\",\n \"id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"queue_id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"runnable_ref\": \"weave:///entity/project/op/name:digest\",\n \"scorer_rating_confidences\": {},\n \"scorer_rating_reasons\": {},\n \"scorer_ratings\": {},\n \"scorer_tag_confidences\": {},\n \"scorer_tag_reasons\": {},\n \"scorer_tags\": [\n \"<string>\"\n ],\n \"span_agent_name\": \"\",\n \"span_agent_version\": \"\",\n \"span_status_code\": \"UNSET\",\n \"trigger_ref\": \"weave:///entity/project/object/name:digest\",\n \"wb_user_id\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/feedback/replace")

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 \"feedback_id\": \"<string>\",\n \"feedback_type\": \"<string>\",\n \"payload\": {},\n \"project_id\": \"<string>\",\n \"weave_ref\": \"<string>\",\n \"annotation_ref\": \"weave:///entity/project/object/name:digest\",\n \"call_ref\": \"weave:///entity/project/call/call_id\",\n \"creator\": \"Jane Smith\",\n \"id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"queue_id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"runnable_ref\": \"weave:///entity/project/op/name:digest\",\n \"scorer_rating_confidences\": {},\n \"scorer_rating_reasons\": {},\n \"scorer_ratings\": {},\n \"scorer_tag_confidences\": {},\n \"scorer_tag_reasons\": {},\n \"scorer_tags\": [\n \"<string>\"\n ],\n \"span_agent_name\": \"\",\n \"span_agent_version\": \"\",\n \"span_status_code\": \"UNSET\",\n \"trigger_ref\": \"weave:///entity/project/object/name:digest\",\n \"wb_user_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "created_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "payload": {},
  "wb_user_id": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Corps

application/json
feedback_id
string
requis
feedback_type
string
requis
Exemple:

"custom"

payload
Payload · object
requis
Exemple:
{ "key": "value" }
project_id
string
requis
Exemple:

"entity/project"

weave_ref
string
requis
Exemple:

"weave:///entity/project/object/name:digest"

annotation_ref
string | null
Exemple:

"weave:///entity/project/object/name:digest"

call_ref
string | null
Exemple:

"weave:///entity/project/call/call_id"

creator
string | null
Exemple:

"Jane Smith"

id
string | null

S'il est fourni par le client, cet ID sera utilisé pour la ligne de feedback au lieu d'un ID généré par le serveur.

Exemple:

"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b"

queue_id
string | null

ID de la file d'attente d'annotation à partir de laquelle ce feedback a été créé. Référence à annotation_queues.id. NULL lorsque le feedback est créé en dehors des files d'attente.

Exemple:

"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b"

runnable_ref
string | null
Exemple:

"weave:///entity/project/op/name:digest"

scorer_rating_confidences
Scorer Rating Confidences · object

confiance (0-1) par note, avec le nom de la note comme clé

Exemple:
{ "_rating_": 0.92 }
scorer_rating_reasons
Scorer Rating Reasons · object

texte explicatif par note, avec le nom de la note comme clé

Exemple:
{ "_rating_": "very confident response" }
scorer_ratings
Scorer Ratings · object

notes numériques (0-1), avec le nom de la note comme clé

Exemple:
{ "_rating_": 0.87 }
scorer_tag_confidences
Scorer Tag Confidences · object

confiance (0-1) par tag, avec le nom du tag comme clé

Exemple:
{ "nsfw": 0.92 }
scorer_tag_reasons
Scorer Tag Reasons · object

texte explicatif par tag, avec le nom du tag comme clé

Exemple:
{ "nsfw": "Contains explicit language" }
scorer_tags
string[]

Tags appliqués à la ref par un scorer

Exemple:
["nsfw", "high-quality"]
span_agent_name
string
défaut:""

Nom d’affichage de l’agent évalué (à partir de spans.agent_name)

Exemple:

"midi-generator"

span_agent_version
string
défaut:""

Version de l’agent évalué (à partir de spans.agent_version)

Exemple:

"1.2.0"

span_status_code
string
défaut:UNSET

Statut du tour de conversation évalué (à partir de spans.status_code)

Exemple:

"SUCCESS"

trigger_ref
string | null
Exemple:

"weave:///entity/project/object/name:digest"

wb_user_id
string | null

Ne définissez pas ce champ directement. Le serveur le renseignera automatiquement.

Réponse

Réponse réussie

created_at
string<date-time>
requis
id
string
requis
payload
Payload · object
requis
wb_user_id
string
requis