Set Reflow
curl --request PUT \
--url https://{host}/api/model-deployments/{deployment_id}/reflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sample_rate": 0,
"retention_days": 30,
"capture_system_prompt": true
}
'import requests
url = "https://{host}/api/model-deployments/{deployment_id}/reflow"
payload = {
"sample_rate": 0,
"retention_days": 30,
"capture_system_prompt": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sample_rate: 0, retention_days: 30, capture_system_prompt: true})
};
fetch('https://{host}/api/model-deployments/{deployment_id}/reflow', 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://{host}/api/model-deployments/{deployment_id}/reflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sample_rate' => 0,
'retention_days' => 30,
'capture_system_prompt' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{host}/api/model-deployments/{deployment_id}/reflow"
payload := strings.NewReader("{\n \"sample_rate\": 0,\n \"retention_days\": 30,\n \"capture_system_prompt\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://{host}/api/model-deployments/{deployment_id}/reflow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sample_rate\": 0,\n \"retention_days\": 30,\n \"capture_system_prompt\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/model-deployments/{deployment_id}/reflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sample_rate\": 0,\n \"retention_days\": 30,\n \"capture_system_prompt\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"owner_user_id": 123,
"owner_username": "<string>",
"desired_state": "<string>",
"status": "<string>",
"endpoint_path": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"fleet_id": "",
"serve_mode": "proxied",
"current_revision_id": "<string>",
"candidate_revision_id": "<string>",
"last_error": "<string>",
"current_revision": {
"id": "<string>",
"deployment_id": "<string>",
"sequence": 123,
"engine": "<string>",
"model_source": {},
"config": {},
"status": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"runtime_ref": "<string>",
"runtime_meta": {},
"internal_endpoint": "<string>",
"error": "<string>",
"ready_at": "2023-11-07T05:31:56Z",
"retired_at": "2023-11-07T05:31:56Z"
},
"candidate_revision": {
"id": "<string>",
"deployment_id": "<string>",
"sequence": 123,
"engine": "<string>",
"model_source": {},
"config": {},
"status": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"runtime_ref": "<string>",
"runtime_meta": {},
"internal_endpoint": "<string>",
"error": "<string>",
"ready_at": "2023-11-07T05:31:56Z",
"retired_at": "2023-11-07T05:31:56Z"
},
"revisions": [
{
"id": "<string>",
"deployment_id": "<string>",
"sequence": 123,
"engine": "<string>",
"model_source": {},
"config": {},
"status": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"runtime_ref": "<string>",
"runtime_meta": {},
"internal_endpoint": "<string>",
"error": "<string>",
"ready_at": "2023-11-07T05:31:56Z",
"retired_at": "2023-11-07T05:31:56Z"
}
],
"tokens": [
{
"id": "<string>",
"deployment_id": "<string>",
"name": "<string>",
"prefix": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
],
"reflow_sample_rate": 0,
"reflow_retention_days": 30,
"reflow_capture_system_prompt": true,
"reflow_dropped_total": 0,
"reflow_trimmed_total": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Set Reflow
Turn production capture on or off for one deployment.
Audited on every change, including the values: enabling capture of real user traffic is a decision somebody made on a date, and it has to be answerable later without reconstructing it from the data that appeared.
PUT
/
api
/
model-deployments
/
{deployment_id}
/
reflow
Set Reflow
curl --request PUT \
--url https://{host}/api/model-deployments/{deployment_id}/reflow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sample_rate": 0,
"retention_days": 30,
"capture_system_prompt": true
}
'import requests
url = "https://{host}/api/model-deployments/{deployment_id}/reflow"
payload = {
"sample_rate": 0,
"retention_days": 30,
"capture_system_prompt": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sample_rate: 0, retention_days: 30, capture_system_prompt: true})
};
fetch('https://{host}/api/model-deployments/{deployment_id}/reflow', 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://{host}/api/model-deployments/{deployment_id}/reflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sample_rate' => 0,
'retention_days' => 30,
'capture_system_prompt' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{host}/api/model-deployments/{deployment_id}/reflow"
payload := strings.NewReader("{\n \"sample_rate\": 0,\n \"retention_days\": 30,\n \"capture_system_prompt\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://{host}/api/model-deployments/{deployment_id}/reflow")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sample_rate\": 0,\n \"retention_days\": 30,\n \"capture_system_prompt\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/model-deployments/{deployment_id}/reflow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sample_rate\": 0,\n \"retention_days\": 30,\n \"capture_system_prompt\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"owner_user_id": 123,
"owner_username": "<string>",
"desired_state": "<string>",
"status": "<string>",
"endpoint_path": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"fleet_id": "",
"serve_mode": "proxied",
"current_revision_id": "<string>",
"candidate_revision_id": "<string>",
"last_error": "<string>",
"current_revision": {
"id": "<string>",
"deployment_id": "<string>",
"sequence": 123,
"engine": "<string>",
"model_source": {},
"config": {},
"status": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"runtime_ref": "<string>",
"runtime_meta": {},
"internal_endpoint": "<string>",
"error": "<string>",
"ready_at": "2023-11-07T05:31:56Z",
"retired_at": "2023-11-07T05:31:56Z"
},
"candidate_revision": {
"id": "<string>",
"deployment_id": "<string>",
"sequence": 123,
"engine": "<string>",
"model_source": {},
"config": {},
"status": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"runtime_ref": "<string>",
"runtime_meta": {},
"internal_endpoint": "<string>",
"error": "<string>",
"ready_at": "2023-11-07T05:31:56Z",
"retired_at": "2023-11-07T05:31:56Z"
},
"revisions": [
{
"id": "<string>",
"deployment_id": "<string>",
"sequence": 123,
"engine": "<string>",
"model_source": {},
"config": {},
"status": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"runtime_ref": "<string>",
"runtime_meta": {},
"internal_endpoint": "<string>",
"error": "<string>",
"ready_at": "2023-11-07T05:31:56Z",
"retired_at": "2023-11-07T05:31:56Z"
}
],
"tokens": [
{
"id": "<string>",
"deployment_id": "<string>",
"name": "<string>",
"prefix": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
],
"reflow_sample_rate": 0,
"reflow_retention_days": 30,
"reflow_capture_system_prompt": true,
"reflow_dropped_total": 0,
"reflow_trimmed_total": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
请求体
application/json
响应
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes