Routing Studio
列出路由偏好設置
列出調用方可見的所有路由工作室偏好設置。
GET
/
api
/
v1
/
routing-preferences
列出路由偏好設置
curl --request GET \
--url https://api.example.com/api/v1/routing-preferencesimport requests
url = "https://api.example.com/api/v1/routing-preferences"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/routing-preferences', 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/api/v1/routing-preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/routing-preferences"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/routing-preferences")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/routing-preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"routing_preferences": [
{}
]
}返回由調用方創建的所有偏好設置,以及當前組織中所有團隊級偏好設置。每條偏好設置都包含一組關鍵詞規則、少樣本示例,以及針對各模式的置信度下限覆蓋項,用於讓 Theo 的路由引擎向調用方所在領域傾斜。
隱藏的按密鑰偏好設置(支撐按密鑰路由規則界面的記錄)不包含在此列表中——請改用
/api/v1/keys/{id}/routing-rules 來管理它們。
身份驗證
需要具備billing API 密鑰權限範圍的 Bearer 令牌。請參閱身份驗證。
請求示例
curl https://www.hitheo.ai/api/v1/routing-preferences \
-H "Authorization: Bearer $THEO_API_KEY"
const prefs = await theo.routingPreferences.list();
響應
object[]
偏好設置對象數組。每個偏好設置包含
id、name、description、user_id、org_id、enabled、is_default、rules、examples 以及 confidence_floor_overrides。響應示例
{
"routing_preferences": [
{
"id": "1f4f2c1a-22ce-4b07-9c0b-9c4f4b9b1d2e",
"name": "ContractIQ Legal",
"description": "Contract terms get the analytical engine.",
"user_id": "user_abc",
"org_id": null,
"enabled": true,
"is_default": false,
"rules": [
{
"id": "r_a4b8c01x9y",
"pattern": "\\b(clause|provision|indemnity|warranty)\\b",
"target_mode": "think",
"confidence": 0.92,
"description": "Contract terms get the analytical engine."
}
],
"examples": [
{ "prompt": "Look at this clause", "expected_mode": "think" }
],
"confidence_floor_overrides": {
"think": 0.65
}
}
]
}
這個頁面有幫助嗎?
列出路由偏好設置
curl --request GET \
--url https://api.example.com/api/v1/routing-preferencesimport requests
url = "https://api.example.com/api/v1/routing-preferences"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/routing-preferences', 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/api/v1/routing-preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/routing-preferences"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/routing-preferences")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/routing-preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"routing_preferences": [
{}
]
}