اتخاذ قرارات منظّمة
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'typesafe/jev-1.13.0',
state: '<string>',
questions: {},
images: ['<string>'],
meta: false,
echo_upstream_request: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true
},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
routing: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
metadata: {}
})
};
fetch('https://api.phaseo.app/v1/decisions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/decisions"
payload = {
"model": "typesafe/jev-1.13.0",
"state": "<string>",
"questions": {},
"images": ["<string>"],
"meta": False,
"echo_upstream_request": True,
"debug": {
"enabled": True,
"return_upstream_request": True,
"return_upstream_response": True,
"trace": True
},
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.app/v1/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "typesafe/jev-1.13.0",
"state": "<string>",
"questions": {},
"images": [
"<string>"
],
"meta": false,
"echo_upstream_request": true,
"debug": {
"enabled": true,
"return_upstream_request": true,
"return_upstream_response": true,
"trace": true
},
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/decisions"
payload := strings.NewReader("{\n \"model\": \"typesafe/jev-1.13.0\",\n \"state\": \"<string>\",\n \"questions\": {},\n \"images\": [\n \"<string>\"\n ],\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.phaseo.app/v1/decisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"typesafe/jev-1.13.0\",\n \"state\": \"<string>\",\n \"questions\": {},\n \"images\": [\n \"<string>\"\n ],\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/decisions",
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([
'model' => 'typesafe/jev-1.13.0',
'state' => '<string>',
'questions' => [
],
'images' => [
'<string>'
],
'meta' => false,
'echo_upstream_request' => true,
'debug' => [
'enabled' => true,
'return_upstream_request' => true,
'return_upstream_response' => true,
'trace' => true
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'routing' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'metadata' => [
]
]),
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;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/decisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"typesafe/jev-1.13.0\",\n \"state\": \"<string>\",\n \"questions\": {},\n \"images\": [\n \"<string>\"\n ],\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": {},
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1
},
"request_id": "<string>",
"meta": {}
}القرارات
اتخاذ قرار
قيّم أسئلة ذات أنواع محددة بناءً على حالة التطبيق باستخدام نماذج القرار المدعومة.
POST
/
decisions
اتخاذ قرارات منظّمة
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'typesafe/jev-1.13.0',
state: '<string>',
questions: {},
images: ['<string>'],
meta: false,
echo_upstream_request: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true
},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
routing: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
metadata: {}
})
};
fetch('https://api.phaseo.app/v1/decisions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/decisions"
payload = {
"model": "typesafe/jev-1.13.0",
"state": "<string>",
"questions": {},
"images": ["<string>"],
"meta": False,
"echo_upstream_request": True,
"debug": {
"enabled": True,
"return_upstream_request": True,
"return_upstream_response": True,
"trace": True
},
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.app/v1/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "typesafe/jev-1.13.0",
"state": "<string>",
"questions": {},
"images": [
"<string>"
],
"meta": false,
"echo_upstream_request": true,
"debug": {
"enabled": true,
"return_upstream_request": true,
"return_upstream_response": true,
"trace": true
},
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"routing": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"metadata": {}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/decisions"
payload := strings.NewReader("{\n \"model\": \"typesafe/jev-1.13.0\",\n \"state\": \"<string>\",\n \"questions\": {},\n \"images\": [\n \"<string>\"\n ],\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.phaseo.app/v1/decisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"typesafe/jev-1.13.0\",\n \"state\": \"<string>\",\n \"questions\": {},\n \"images\": [\n \"<string>\"\n ],\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/decisions",
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([
'model' => 'typesafe/jev-1.13.0',
'state' => '<string>',
'questions' => [
],
'images' => [
'<string>'
],
'meta' => false,
'echo_upstream_request' => true,
'debug' => [
'enabled' => true,
'return_upstream_request' => true,
'return_upstream_response' => true,
'trace' => true
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'routing' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'metadata' => [
]
]),
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;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/decisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"typesafe/jev-1.13.0\",\n \"state\": \"<string>\",\n \"questions\": {},\n \"images\": [\n \"<string>\"\n ],\n \"meta\": false,\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"routing\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"answers": {},
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1
},
"request_id": "<string>",
"meta": {}
}استخدم
يدعم Jev الجمع بين أنواع الأسئلة الثلاثة في طلب واحد؛ ويدعم Span-01 أسئلة
يمكنك أيضًا توفير سلسلة
POST /v1/decisions عندما يحتاج تطبيقك إلى إجابات منظّمة يمكن للكود استهلاكها مباشرةً. تشمل النماذج المدعومة TypeSafe Jev 1.13 (typesafe/jev-1.13.0) وTogether Tev1 4B Experimental (together/tev1-4b-experimental) وRespan Span-01 (respan/span-01:free وrespan/span-01).
يتضمن الطلب:
state: سلسلة أو كائن أو مصفوفة تحتوي على المعلومات المطلوب تقييمها.questions: خريطة للأسئلة المسماة. يضبط كل سؤالtypeعلىnoulأوchoiceأوscoreويتضمنinstructions؛ وتعتمد الأنواع المدعومة على النموذج المحدد.model: معرّف نموذج Phaseo. استخدمtypesafe/jev-1.13.0لـ Jev 1.13، أوtypesafe/jev-latestلمتابعة أحدث إصدار من Jev.
liquid-ai/d1:free، والمتاح أيضًا باسم liquid-ai/d1) وPerplexity Decider 27B (perplexity/decider-27b) أنواع الأسئلة الثلاثة. D1 مجاني خلال الوصول المبكر التجريبي. تبلغ تكلفة Decider 0.04 دولار لكل مليون رمز إدخال، بما فيها رموز الصور؛ ورموز الإخراج مجانية. أضف بيانات اعتماد لمزود Perplexity في Phaseo لاستخدام Decider. تستخدم حالته المصورة عناوين URL لبيانات base64 بصيغ PNG أو JPEG أو WebP؛ ولا يدعم عناوين الصور البعيدة. يقبل كل سؤال اختيار ما يصل إلى 255 خيارًا، وكل سؤال تقييم ما يصل إلى 10 مستويات. تحقّق من توفر النموذج قبل استدعاء أي منهما.
في Respan Span-01، يجب أن تكون state مقطع محادثة يتضمن مصفوفة input للرسائل السابقة ورسالة مساعد output. يدعم Span-01 أسئلة noul فقط. إجابة noul هي احتمال وجود السلوك؛ وتتضمن probabilities أيضًا احتمالات غيابه وتعذّر ملاحظته.
{
"model": "respan/span-01:free",
"state": {
"input": [{ "role": "user", "content": "Please connect me to a person." }],
"output": { "role": "assistant", "content": "I will connect you to support." }
},
"questions": {
"escalation": {
"type": "noul",
"instructions": "Does the assistant offer a human handoff?"
}
}
}
respan/span-01:free هو نموذج Lite المجاني ذو الحد اليومي؛ ويطابقه Phaseo مع معرّف نموذج API الخاص بـ Respan وهو span-01-free. يطابق respan/span-01 المعرّف span-01-pro، وتفرض Respan عليه 0.02 دولار لكل مليون رمز إدخال؛ ورموز الإخراج مجانية. Span-01 في مرحلة الوصول المبكر، لذا يجب أن تفعّل Respan الوصول لمؤسستك. أضف مفتاح API الخاص بك لدى Respan كبيانات اعتماد لمزود Respan في Phaseo قبل استدعاء هذه النماذج.
تستخدم الإجابات المفاتيح نفسها الموجودة في questions. تتضمن إجابات choice الخيار المحدد والاحتمالات والثقة؛ وتتضمن إجابات noul احتمالًا من 0 إلى 1؛ وتتضمن إجابات score درجة مرجّحة بالاحتمالات ودليلًا توضيحيًا والاحتمالات والثقة.
في مثال Respan، تبدو الاستجابة كما يلي:
{
"answers": {
"escalation": {
"type": "noul",
"noul": 0.73,
"probabilities": {
"true": 0.73,
"false": 0.25,
"not_observable": 0.02
}
}
}
}
noul فقط. راجع البدء السريع لأمثلة جاهزة للنسخ في cURL وJavaScript وSDK TypeScript وSDK Python. تبلغ تكلفة Jev 1.13 0.042 دولار لكل مليون رمز إدخال؛ ورموز الإخراج مجانية.
لمعرفة دلالات الأسئلة لدى المزود الأصلي، راجع مرجع API الخاص بـ TypeSafe.
قرارات الصور باستخدام Clef
يدعمcloudflare/clef وcloudflare/clef-flash أنواع الأسئلة الثلاثة والصور المضمّنة عبر Cloudflare Workers AI. لكل منهما نافذة سياق من 65,536 رمزًا. تبلغ تكلفة الإدخال 0.24 دولار أمريكي لكل مليون رمز في Clef و0.09 دولار أمريكي في Clef Flash.
{
"model": "cloudflare/clef-flash",
"state": "Inspect the attached product photo.",
"images": [{ "content_type": "image/png", "base64": "<base64 image bytes>" }],
"questions": {
"damaged": { "type": "noul", "instructions": "Is the product visibly damaged?" }
}
}
data:image/png;base64,... في images. يقبل Clef حتى أربع صور PNG أو JPEG أو WebP، على ألا تتجاوز كل صورة 4 MiB و16 ميغابكسل، وألا يتجاوز إجمالي بيانات الصور بعد فك الترميز 8 MiB وحجم جسم الطلب 13 MiB. الروابط البعيدة غير مدعومة. يتحقق Cloudflare من صيغ الصور وأبعادها. ترفض النماذج التي لا تدعم الصور طلبات الصور.
يقبل Clef ما يصل إلى 64 سؤالًا، بمعرّفات تضم حتى 100 حرف أو رقم أو شرطة سفلية أو نقطة أو شرطة. تتطلب أسئلة الاختيار 2–255 خيارًا، وأسئلة الدرجة 2–10 مستويات. راجع وثائق Clef من Cloudflare.التفويضات
المصادقة باستخدام رمز Bearer
الجسم
application/json
معرّف نموذج Phaseo الأساسي أو الاسم المستعار لنموذج المزود.
حالة منظّمة يقيّمها النموذج.
Show child attributes
Show child attributes
صور مضمّنة لنماذج القرار التي تدعم الرؤية. يقبل Clef صيغ PNG أو JPEG أو WebP؛ الروابط البعيدة غير مدعومة. الحد الأقصى 4 MiB و16 ميغابكسل لكل صورة، و8 MiB لإجمالي البيانات بعد فك الترميز، و13 MiB لكل جسم طلب.
Maximum array length:
4Pattern:
^[Dd][Aa][Tt][Aa]:image/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$عناصر تحكم تصحيح أخطاء البوابة. لا تُمرر هذه العلامات إلى المزوّد مطلقًا.
Show child attributes
Show child attributes
تفضيلات توجيه المزوّد لاختياره عبر البوابة.
Show child attributes
Show child attributes
تفضيلات توجيه المزوّد لاختياره عبر البوابة.
Show child attributes
Show child attributes
آخر تعديل في ٢ أكتوبر ٢٠٢٦
هل كانت هذه الصفحة مفيدة؟