Skip to main content
PATCH
/
v1
/
query
/
plan
Edit Plan
curl --request PATCH \
  --url https://api.aryn.cloud/v1/query/plan \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": {
    "docset_id": "<string>",
    "query": "<string>",
    "plan": {
      "query": "<string>",
      "nodes": {},
      "result_node": 123,
      "llm_prompt": "<unknown>",
      "llm_plan": "<string>"
    },
    "stream": false,
    "summarize_result": false,
    "rag_mode": false
  },
  "feedback": "<string>"
}
'
import requests

url = "https://api.aryn.cloud/v1/query/plan"

payload = {
"query": {
"docset_id": "<string>",
"query": "<string>",
"plan": {
"query": "<string>",
"nodes": {},
"result_node": 123,
"llm_prompt": "<unknown>",
"llm_plan": "<string>"
},
"stream": False,
"summarize_result": False,
"rag_mode": False
},
"feedback": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: {
docset_id: '<string>',
query: '<string>',
plan: {
query: '<string>',
nodes: {},
result_node: 123,
llm_prompt: '<unknown>',
llm_plan: '<string>'
},
stream: false,
summarize_result: false,
rag_mode: false
},
feedback: '<string>'
})
};

fetch('https://api.aryn.cloud/v1/query/plan', 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.aryn.cloud/v1/query/plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'query' => [
'docset_id' => '<string>',
'query' => '<string>',
'plan' => [
'query' => '<string>',
'nodes' => [

],
'result_node' => 123,
'llm_prompt' => '<unknown>',
'llm_plan' => '<string>'
],
'stream' => false,
'summarize_result' => false,
'rag_mode' => false
],
'feedback' => '<string>'
]),
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;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.aryn.cloud/v1/query/plan"

payload := strings.NewReader("{\n \"query\": {\n \"docset_id\": \"<string>\",\n \"query\": \"<string>\",\n \"plan\": {\n \"query\": \"<string>\",\n \"nodes\": {},\n \"result_node\": 123,\n \"llm_prompt\": \"<unknown>\",\n \"llm_plan\": \"<string>\"\n },\n \"stream\": false,\n \"summarize_result\": false,\n \"rag_mode\": false\n },\n \"feedback\": \"<string>\"\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.aryn.cloud/v1/query/plan")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"docset_id\": \"<string>\",\n \"query\": \"<string>\",\n \"plan\": {\n \"query\": \"<string>\",\n \"nodes\": {},\n \"result_node\": 123,\n \"llm_prompt\": \"<unknown>\",\n \"llm_plan\": \"<string>\"\n },\n \"stream\": false,\n \"summarize_result\": false,\n \"rag_mode\": false\n },\n \"feedback\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aryn.cloud/v1/query/plan")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": {\n \"docset_id\": \"<string>\",\n \"query\": \"<string>\",\n \"plan\": {\n \"query\": \"<string>\",\n \"nodes\": {},\n \"result_node\": 123,\n \"llm_prompt\": \"<unknown>\",\n \"llm_plan\": \"<string>\"\n },\n \"stream\": false,\n \"summarize_result\": false,\n \"rag_mode\": false\n },\n \"feedback\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "query": "<string>",
  "nodes": {},
  "result_node": 123,
  "llm_prompt": "<unknown>",
  "llm_plan": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
Query · object
required

A query against a DocSet. Contains either a natural language string or a query plan.

feedback
string
required

Feedback about the existing plan or instructions to modify it.

Response

Successful Response

A logical query plan used to evaluate a query.

query
string
required

The query that the plan is for.

nodes
Nodes · object
required

A mapping of node IDs to nodes in the query plan.

result_node
integer
required

The ID of the node that is the result of the query.

llm_prompt
any | null

The LLM prompt that was used to generate this query plan.

llm_plan
string | null

The result generated by the LLM.