curl --request POST \
--url https://llm-gateway.assemblyai.com/v1/decisions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "gpt-6-luna",
"input": "Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\nCustomer: Sure, it's 4471-2209.\nAgent: Thanks. And can you confirm the address on the account?\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\nCustomer: Okay, that's fine. Thanks for letting me know.",
"questions": [
{
"type": "predicate",
"name": "confirmed_account_details",
"instructions": "Did the agent ask the caller to confirm their account details?"
},
{
"type": "choice",
"name": "call_outcome",
"instructions": "How did the call end?",
"choices": [
{
"value": "resolved",
"description": "The issue was fixed or fully answered on the call"
},
{
"value": "follow_up",
"description": "The customer was told the issue will be fixed later"
},
{
"value": "escalated",
"description": "The call was transferred or escalated"
}
]
},
{
"type": "score",
"name": "customer_sentiment",
"instructions": "How did the customer feel at the end of the call?",
"levels": [
{
"label": "negative",
"description": "Upset or frustrated"
},
{
"label": "neutral",
"description": "Neither upset nor pleased"
},
{
"label": "positive",
"description": "Satisfied or thankful"
}
]
}
]
}
EOFimport requests
url = "https://llm-gateway.assemblyai.com/v1/decisions"
payload = {
"model": "gpt-6-luna",
"input": "Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?
Customer: Sure, it's 4471-2209.
Agent: Thanks. And can you confirm the address on the account?
Customer: 18 Harbor Lane. My internet has dropped three times today and I work from home.
Agent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.
Customer: Okay, that's fine. Thanks for letting me know.",
"questions": [
{
"type": "predicate",
"name": "confirmed_account_details",
"instructions": "Did the agent ask the caller to confirm their account details?"
},
{
"type": "choice",
"name": "call_outcome",
"instructions": "How did the call end?",
"choices": [
{
"value": "resolved",
"description": "The issue was fixed or fully answered on the call"
},
{
"value": "follow_up",
"description": "The customer was told the issue will be fixed later"
},
{
"value": "escalated",
"description": "The call was transferred or escalated"
}
]
},
{
"type": "score",
"name": "customer_sentiment",
"instructions": "How did the customer feel at the end of the call?",
"levels": [
{
"label": "negative",
"description": "Upset or frustrated"
},
{
"label": "neutral",
"description": "Neither upset nor pleased"
},
{
"label": "positive",
"description": "Satisfied or thankful"
}
]
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-6-luna',
input: 'Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\nCustomer: Sure, it\'s 4471-2209.\nAgent: Thanks. And can you confirm the address on the account?\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\nAgent: I\'m sorry about that. There\'s an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\nCustomer: Okay, that\'s fine. Thanks for letting me know.',
questions: [
{
type: 'predicate',
name: 'confirmed_account_details',
instructions: 'Did the agent ask the caller to confirm their account details?'
},
{
type: 'choice',
name: 'call_outcome',
instructions: 'How did the call end?',
choices: [
{
value: 'resolved',
description: 'The issue was fixed or fully answered on the call'
},
{
value: 'follow_up',
description: 'The customer was told the issue will be fixed later'
},
{value: 'escalated', description: 'The call was transferred or escalated'}
]
},
{
type: 'score',
name: 'customer_sentiment',
instructions: 'How did the customer feel at the end of the call?',
levels: [
{label: 'negative', description: 'Upset or frustrated'},
{label: 'neutral', description: 'Neither upset nor pleased'},
{label: 'positive', description: 'Satisfied or thankful'}
]
}
]
})
};
fetch('https://llm-gateway.assemblyai.com/v1/decisions', 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://llm-gateway.assemblyai.com/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' => 'gpt-6-luna',
'input' => 'Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?
Customer: Sure, it\'s 4471-2209.
Agent: Thanks. And can you confirm the address on the account?
Customer: 18 Harbor Lane. My internet has dropped three times today and I work from home.
Agent: I\'m sorry about that. There\'s an outage in your area. A technician is already on it, and it should be fixed by 5 PM.
Customer: Okay, that\'s fine. Thanks for letting me know.',
'questions' => [
[
'type' => 'predicate',
'name' => 'confirmed_account_details',
'instructions' => 'Did the agent ask the caller to confirm their account details?'
],
[
'type' => 'choice',
'name' => 'call_outcome',
'instructions' => 'How did the call end?',
'choices' => [
[
'value' => 'resolved',
'description' => 'The issue was fixed or fully answered on the call'
],
[
'value' => 'follow_up',
'description' => 'The customer was told the issue will be fixed later'
],
[
'value' => 'escalated',
'description' => 'The call was transferred or escalated'
]
]
],
[
'type' => 'score',
'name' => 'customer_sentiment',
'instructions' => 'How did the customer feel at the end of the call?',
'levels' => [
[
'label' => 'negative',
'description' => 'Upset or frustrated'
],
[
'label' => 'neutral',
'description' => 'Neither upset nor pleased'
],
[
'label' => 'positive',
'description' => 'Satisfied or thankful'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://llm-gateway.assemblyai.com/v1/decisions"
payload := strings.NewReader("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\\nCustomer: Sure, it's 4471-2209.\\nAgent: Thanks. And can you confirm the address on the account?\\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\\nCustomer: Okay, that's fine. Thanks for letting me know.\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"name\": \"confirmed_account_details\",\n \"instructions\": \"Did the agent ask the caller to confirm their account details?\"\n },\n {\n \"type\": \"choice\",\n \"name\": \"call_outcome\",\n \"instructions\": \"How did the call end?\",\n \"choices\": [\n {\n \"value\": \"resolved\",\n \"description\": \"The issue was fixed or fully answered on the call\"\n },\n {\n \"value\": \"follow_up\",\n \"description\": \"The customer was told the issue will be fixed later\"\n },\n {\n \"value\": \"escalated\",\n \"description\": \"The call was transferred or escalated\"\n }\n ]\n },\n {\n \"type\": \"score\",\n \"name\": \"customer_sentiment\",\n \"instructions\": \"How did the customer feel at the end of the call?\",\n \"levels\": [\n {\n \"label\": \"negative\",\n \"description\": \"Upset or frustrated\"\n },\n {\n \"label\": \"neutral\",\n \"description\": \"Neither upset nor pleased\"\n },\n {\n \"label\": \"positive\",\n \"description\": \"Satisfied or thankful\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://llm-gateway.assemblyai.com/v1/decisions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\\nCustomer: Sure, it's 4471-2209.\\nAgent: Thanks. And can you confirm the address on the account?\\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\\nCustomer: Okay, that's fine. Thanks for letting me know.\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"name\": \"confirmed_account_details\",\n \"instructions\": \"Did the agent ask the caller to confirm their account details?\"\n },\n {\n \"type\": \"choice\",\n \"name\": \"call_outcome\",\n \"instructions\": \"How did the call end?\",\n \"choices\": [\n {\n \"value\": \"resolved\",\n \"description\": \"The issue was fixed or fully answered on the call\"\n },\n {\n \"value\": \"follow_up\",\n \"description\": \"The customer was told the issue will be fixed later\"\n },\n {\n \"value\": \"escalated\",\n \"description\": \"The call was transferred or escalated\"\n }\n ]\n },\n {\n \"type\": \"score\",\n \"name\": \"customer_sentiment\",\n \"instructions\": \"How did the customer feel at the end of the call?\",\n \"levels\": [\n {\n \"label\": \"negative\",\n \"description\": \"Upset or frustrated\"\n },\n {\n \"label\": \"neutral\",\n \"description\": \"Neither upset nor pleased\"\n },\n {\n \"label\": \"positive\",\n \"description\": \"Satisfied or thankful\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://llm-gateway.assemblyai.com/v1/decisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-6-luna\",\n \"input\": \"Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\\nCustomer: Sure, it's 4471-2209.\\nAgent: Thanks. And can you confirm the address on the account?\\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\\nCustomer: Okay, that's fine. Thanks for letting me know.\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"name\": \"confirmed_account_details\",\n \"instructions\": \"Did the agent ask the caller to confirm their account details?\"\n },\n {\n \"type\": \"choice\",\n \"name\": \"call_outcome\",\n \"instructions\": \"How did the call end?\",\n \"choices\": [\n {\n \"value\": \"resolved\",\n \"description\": \"The issue was fixed or fully answered on the call\"\n },\n {\n \"value\": \"follow_up\",\n \"description\": \"The customer was told the issue will be fixed later\"\n },\n {\n \"value\": \"escalated\",\n \"description\": \"The call was transferred or escalated\"\n }\n ]\n },\n {\n \"type\": \"score\",\n \"name\": \"customer_sentiment\",\n \"instructions\": \"How did the customer feel at the end of the call?\",\n \"levels\": [\n {\n \"label\": \"negative\",\n \"description\": \"Upset or frustrated\"\n },\n {\n \"label\": \"neutral\",\n \"description\": \"Neither upset nor pleased\"\n },\n {\n \"label\": \"positive\",\n \"description\": \"Satisfied or thankful\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model": "<string>",
"answers": [
{
"type": "predicate",
"name": "<string>",
"probability": 123,
"choice": "<string>",
"score": 123,
"probabilities": [
{
"value": "<string>",
"label": "<string>",
"probability": 123
}
],
"confidence": 123
}
],
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123,
"cache_write_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
},
"total_tokens": 123
}
}{
"code": 123,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {
"errors": [
"<string>"
]
}
}{
"code": 123,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {
"errors": [
"<string>"
]
}
}Create a decision
Answers a list of typed questions about one input. Each answer carries a probability instead of generated text. Available on the US server only. See Decisions for the full guide.
curl --request POST \
--url https://llm-gateway.assemblyai.com/v1/decisions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "gpt-6-luna",
"input": "Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\nCustomer: Sure, it's 4471-2209.\nAgent: Thanks. And can you confirm the address on the account?\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\nCustomer: Okay, that's fine. Thanks for letting me know.",
"questions": [
{
"type": "predicate",
"name": "confirmed_account_details",
"instructions": "Did the agent ask the caller to confirm their account details?"
},
{
"type": "choice",
"name": "call_outcome",
"instructions": "How did the call end?",
"choices": [
{
"value": "resolved",
"description": "The issue was fixed or fully answered on the call"
},
{
"value": "follow_up",
"description": "The customer was told the issue will be fixed later"
},
{
"value": "escalated",
"description": "The call was transferred or escalated"
}
]
},
{
"type": "score",
"name": "customer_sentiment",
"instructions": "How did the customer feel at the end of the call?",
"levels": [
{
"label": "negative",
"description": "Upset or frustrated"
},
{
"label": "neutral",
"description": "Neither upset nor pleased"
},
{
"label": "positive",
"description": "Satisfied or thankful"
}
]
}
]
}
EOFimport requests
url = "https://llm-gateway.assemblyai.com/v1/decisions"
payload = {
"model": "gpt-6-luna",
"input": "Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?
Customer: Sure, it's 4471-2209.
Agent: Thanks. And can you confirm the address on the account?
Customer: 18 Harbor Lane. My internet has dropped three times today and I work from home.
Agent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.
Customer: Okay, that's fine. Thanks for letting me know.",
"questions": [
{
"type": "predicate",
"name": "confirmed_account_details",
"instructions": "Did the agent ask the caller to confirm their account details?"
},
{
"type": "choice",
"name": "call_outcome",
"instructions": "How did the call end?",
"choices": [
{
"value": "resolved",
"description": "The issue was fixed or fully answered on the call"
},
{
"value": "follow_up",
"description": "The customer was told the issue will be fixed later"
},
{
"value": "escalated",
"description": "The call was transferred or escalated"
}
]
},
{
"type": "score",
"name": "customer_sentiment",
"instructions": "How did the customer feel at the end of the call?",
"levels": [
{
"label": "negative",
"description": "Upset or frustrated"
},
{
"label": "neutral",
"description": "Neither upset nor pleased"
},
{
"label": "positive",
"description": "Satisfied or thankful"
}
]
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-6-luna',
input: 'Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\nCustomer: Sure, it\'s 4471-2209.\nAgent: Thanks. And can you confirm the address on the account?\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\nAgent: I\'m sorry about that. There\'s an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\nCustomer: Okay, that\'s fine. Thanks for letting me know.',
questions: [
{
type: 'predicate',
name: 'confirmed_account_details',
instructions: 'Did the agent ask the caller to confirm their account details?'
},
{
type: 'choice',
name: 'call_outcome',
instructions: 'How did the call end?',
choices: [
{
value: 'resolved',
description: 'The issue was fixed or fully answered on the call'
},
{
value: 'follow_up',
description: 'The customer was told the issue will be fixed later'
},
{value: 'escalated', description: 'The call was transferred or escalated'}
]
},
{
type: 'score',
name: 'customer_sentiment',
instructions: 'How did the customer feel at the end of the call?',
levels: [
{label: 'negative', description: 'Upset or frustrated'},
{label: 'neutral', description: 'Neither upset nor pleased'},
{label: 'positive', description: 'Satisfied or thankful'}
]
}
]
})
};
fetch('https://llm-gateway.assemblyai.com/v1/decisions', 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://llm-gateway.assemblyai.com/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' => 'gpt-6-luna',
'input' => 'Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?
Customer: Sure, it\'s 4471-2209.
Agent: Thanks. And can you confirm the address on the account?
Customer: 18 Harbor Lane. My internet has dropped three times today and I work from home.
Agent: I\'m sorry about that. There\'s an outage in your area. A technician is already on it, and it should be fixed by 5 PM.
Customer: Okay, that\'s fine. Thanks for letting me know.',
'questions' => [
[
'type' => 'predicate',
'name' => 'confirmed_account_details',
'instructions' => 'Did the agent ask the caller to confirm their account details?'
],
[
'type' => 'choice',
'name' => 'call_outcome',
'instructions' => 'How did the call end?',
'choices' => [
[
'value' => 'resolved',
'description' => 'The issue was fixed or fully answered on the call'
],
[
'value' => 'follow_up',
'description' => 'The customer was told the issue will be fixed later'
],
[
'value' => 'escalated',
'description' => 'The call was transferred or escalated'
]
]
],
[
'type' => 'score',
'name' => 'customer_sentiment',
'instructions' => 'How did the customer feel at the end of the call?',
'levels' => [
[
'label' => 'negative',
'description' => 'Upset or frustrated'
],
[
'label' => 'neutral',
'description' => 'Neither upset nor pleased'
],
[
'label' => 'positive',
'description' => 'Satisfied or thankful'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://llm-gateway.assemblyai.com/v1/decisions"
payload := strings.NewReader("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\\nCustomer: Sure, it's 4471-2209.\\nAgent: Thanks. And can you confirm the address on the account?\\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\\nCustomer: Okay, that's fine. Thanks for letting me know.\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"name\": \"confirmed_account_details\",\n \"instructions\": \"Did the agent ask the caller to confirm their account details?\"\n },\n {\n \"type\": \"choice\",\n \"name\": \"call_outcome\",\n \"instructions\": \"How did the call end?\",\n \"choices\": [\n {\n \"value\": \"resolved\",\n \"description\": \"The issue was fixed or fully answered on the call\"\n },\n {\n \"value\": \"follow_up\",\n \"description\": \"The customer was told the issue will be fixed later\"\n },\n {\n \"value\": \"escalated\",\n \"description\": \"The call was transferred or escalated\"\n }\n ]\n },\n {\n \"type\": \"score\",\n \"name\": \"customer_sentiment\",\n \"instructions\": \"How did the customer feel at the end of the call?\",\n \"levels\": [\n {\n \"label\": \"negative\",\n \"description\": \"Upset or frustrated\"\n },\n {\n \"label\": \"neutral\",\n \"description\": \"Neither upset nor pleased\"\n },\n {\n \"label\": \"positive\",\n \"description\": \"Satisfied or thankful\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://llm-gateway.assemblyai.com/v1/decisions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\\nCustomer: Sure, it's 4471-2209.\\nAgent: Thanks. And can you confirm the address on the account?\\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\\nCustomer: Okay, that's fine. Thanks for letting me know.\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"name\": \"confirmed_account_details\",\n \"instructions\": \"Did the agent ask the caller to confirm their account details?\"\n },\n {\n \"type\": \"choice\",\n \"name\": \"call_outcome\",\n \"instructions\": \"How did the call end?\",\n \"choices\": [\n {\n \"value\": \"resolved\",\n \"description\": \"The issue was fixed or fully answered on the call\"\n },\n {\n \"value\": \"follow_up\",\n \"description\": \"The customer was told the issue will be fixed later\"\n },\n {\n \"value\": \"escalated\",\n \"description\": \"The call was transferred or escalated\"\n }\n ]\n },\n {\n \"type\": \"score\",\n \"name\": \"customer_sentiment\",\n \"instructions\": \"How did the customer feel at the end of the call?\",\n \"levels\": [\n {\n \"label\": \"negative\",\n \"description\": \"Upset or frustrated\"\n },\n {\n \"label\": \"neutral\",\n \"description\": \"Neither upset nor pleased\"\n },\n {\n \"label\": \"positive\",\n \"description\": \"Satisfied or thankful\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://llm-gateway.assemblyai.com/v1/decisions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-6-luna\",\n \"input\": \"Agent: Thanks for calling Northwind Internet, this is Priya. Can I get your account number?\\nCustomer: Sure, it's 4471-2209.\\nAgent: Thanks. And can you confirm the address on the account?\\nCustomer: 18 Harbor Lane. My internet has dropped three times today and I work from home.\\nAgent: I'm sorry about that. There's an outage in your area. A technician is already on it, and it should be fixed by 5 PM.\\nCustomer: Okay, that's fine. Thanks for letting me know.\",\n \"questions\": [\n {\n \"type\": \"predicate\",\n \"name\": \"confirmed_account_details\",\n \"instructions\": \"Did the agent ask the caller to confirm their account details?\"\n },\n {\n \"type\": \"choice\",\n \"name\": \"call_outcome\",\n \"instructions\": \"How did the call end?\",\n \"choices\": [\n {\n \"value\": \"resolved\",\n \"description\": \"The issue was fixed or fully answered on the call\"\n },\n {\n \"value\": \"follow_up\",\n \"description\": \"The customer was told the issue will be fixed later\"\n },\n {\n \"value\": \"escalated\",\n \"description\": \"The call was transferred or escalated\"\n }\n ]\n },\n {\n \"type\": \"score\",\n \"name\": \"customer_sentiment\",\n \"instructions\": \"How did the customer feel at the end of the call?\",\n \"levels\": [\n {\n \"label\": \"negative\",\n \"description\": \"Upset or frustrated\"\n },\n {\n \"label\": \"neutral\",\n \"description\": \"Neither upset nor pleased\"\n },\n {\n \"label\": \"positive\",\n \"description\": \"Satisfied or thankful\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model": "<string>",
"answers": [
{
"type": "predicate",
"name": "<string>",
"probability": 123,
"choice": "<string>",
"score": 123,
"probabilities": [
{
"value": "<string>",
"label": "<string>",
"probability": 123
}
],
"confidence": 123
}
],
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123,
"cache_write_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
},
"total_tokens": 123
}
}{
"code": 123,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {
"errors": [
"<string>"
]
}
}{
"code": 123,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {
"errors": [
"<string>"
]
}
}Authorizations
Body
The request body for the decisions endpoint. Unknown fields are rejected.
The model to use. jev-1.13.0 requires accepting the Jev opt-in on the Data Controls page.
gpt-6-luna, jev-1.13.0 The evidence every question is asked about. A string, or an array of user messages made of input_text parts.
The questions to answer. Names must be unique.
1 - 400 elementsShow child attributes
Show child attributes
Optional. Set to global for global routing. Supported on gpt-6-luna only.
global Optional. Requests with the same key share a prompt cache.
Models to try in order if the main request fails. See Specify fallback models.
Show child attributes
Show child attributes
Configuration for fallback behavior. See Specify fallback models for more details.
Show child attributes
Show child attributes
Was this page helpful?