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": [
{}
]
}