Action suggestions
curl --request GET \
--url https://api.example.com/api/suggestionsimport requests
url = "https://api.example.com/api/suggestions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/suggestions', 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/suggestions",
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/suggestions"
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/suggestions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/suggestions")
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{
"action_name": "<string>",
"success_probability": 123,
"evidence_count": 123,
"reasoning": "<string>"
}Strategies & policy
Action suggestions
The Policy Guide endpoint — ask ‘What should the agent do next?’
GET
/
api
/
suggestions
Action suggestions
curl --request GET \
--url https://api.example.com/api/suggestionsimport requests
url = "https://api.example.com/api/suggestions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/suggestions', 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/suggestions",
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/suggestions"
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/suggestions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/suggestions")
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{
"action_name": "<string>",
"success_probability": 123,
"evidence_count": 123,
"reasoning": "<string>"
}This is the Policy Guide endpoint. Given the current context, it recommends the next best action based on past experiences and learned strategies.
Query parameters
Response
Returns an array ofActionSuggestionResponse objects.
[
{
"action_name": "check_seat_availability",
"success_probability": 0.94,
"evidence_count": 12,
"reasoning": "After confirming the movie title, checking availability has a 94% success rate based on 12 past interactions."
}
]
Usage with the SDK
const suggestions = await client.getActionSuggestions(contextHash, lastActionNode, 3);
if (suggestions.length > 0) {
const best = suggestions[0];
console.log(`Recommended: ${best.action_name} (${(best.success_probability * 100).toFixed(0)}% success)`);
console.log(`Reasoning: ${best.reasoning}`);
}
