Search files
curl --request POST \
--url https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"mode": "hybrid",
"sources": [
"chunks"
],
"group_by": "match",
"filters": {},
"limit": 10,
"neighbors": 0,
"rerank": "auto"
}
'import requests
url = "https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search"
payload = {
"query": "<string>",
"mode": "hybrid",
"sources": ["chunks"],
"group_by": "match",
"filters": {},
"limit": 10,
"neighbors": 0,
"rerank": "auto"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
mode: 'hybrid',
sources: ['chunks'],
group_by: 'match',
filters: {},
limit: 10,
neighbors: 0,
rerank: 'auto'
})
};
fetch('https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search', 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.pnbr.io/v1/orgs/{org}/projects/{project}/files/search",
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([
'query' => '<string>',
'mode' => 'hybrid',
'sources' => [
'chunks'
],
'group_by' => 'match',
'filters' => [
],
'limit' => 10,
'neighbors' => 0,
'rerank' => 'auto'
]),
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.pnbr.io/v1/orgs/{org}/projects/{project}/files/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"mode\": \"hybrid\",\n \"sources\": [\n \"chunks\"\n ],\n \"group_by\": \"match\",\n \"filters\": {},\n \"limit\": 10,\n \"neighbors\": 0,\n \"rerank\": \"auto\"\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.pnbr.io/v1/orgs/{org}/projects/{project}/files/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"mode\": \"hybrid\",\n \"sources\": [\n \"chunks\"\n ],\n \"group_by\": \"match\",\n \"filters\": {},\n \"limit\": 10,\n \"neighbors\": 0,\n \"rerank\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search")
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 \"query\": \"<string>\",\n \"mode\": \"hybrid\",\n \"sources\": [\n \"chunks\"\n ],\n \"group_by\": \"match\",\n \"filters\": {},\n \"limit\": 10,\n \"neighbors\": 0,\n \"rerank\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"query": "<string>",
"mode_requested": "hybrid",
"mode_used": "hybrid",
"sources": [
"chunks"
],
"group_by": "match",
"ranking": {
"profile": "<string>",
"base_order": "<string>"
},
"results": [
{
"rank": 0,
"file": {
"id": "<string>",
"name": "<string>"
},
"version": {
"id": "<string>",
"number": 0
},
"match": {
"kind": "<string>",
"text": "<string>"
},
"scores": {
"base_rank": 0
},
"neighbors": [
{
"chunk_id": "<string>",
"chunk_index": 0,
"text": "<string>",
"location": {
"page": 0,
"section": "<string>",
"start_offset": 0,
"end_offset": 0,
"offset_unit": "<string>"
}
}
]
}
],
"groups": [
{
"file": {
"id": "<string>",
"name": "<string>"
},
"best_rank": 0,
"matches": [
{
"rank": 0,
"file": {
"id": "<string>",
"name": "<string>"
},
"version": {
"id": "<string>",
"number": 0
},
"match": {
"kind": "<string>",
"text": "<string>"
},
"scores": {
"base_rank": 0
},
"neighbors": [
{
"chunk_id": "<string>",
"chunk_index": 0,
"text": "<string>",
"location": {
"page": 0,
"section": "<string>",
"start_offset": 0,
"end_offset": 0,
"offset_unit": "<string>"
}
}
]
}
]
}
],
"candidate_count": 0,
"timing_ms": {
"total": 123
},
"warnings": [
{
"code": "<string>",
"detail": "<string>"
}
]
}
}Search and citations
Search files
Search the project’s File knowledge and return ranked, cited results.
Search files
curl --request POST \
--url https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"mode": "hybrid",
"sources": [
"chunks"
],
"group_by": "match",
"filters": {},
"limit": 10,
"neighbors": 0,
"rerank": "auto"
}
'import requests
url = "https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search"
payload = {
"query": "<string>",
"mode": "hybrid",
"sources": ["chunks"],
"group_by": "match",
"filters": {},
"limit": 10,
"neighbors": 0,
"rerank": "auto"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
mode: 'hybrid',
sources: ['chunks'],
group_by: 'match',
filters: {},
limit: 10,
neighbors: 0,
rerank: 'auto'
})
};
fetch('https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search', 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.pnbr.io/v1/orgs/{org}/projects/{project}/files/search",
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([
'query' => '<string>',
'mode' => 'hybrid',
'sources' => [
'chunks'
],
'group_by' => 'match',
'filters' => [
],
'limit' => 10,
'neighbors' => 0,
'rerank' => 'auto'
]),
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.pnbr.io/v1/orgs/{org}/projects/{project}/files/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"mode\": \"hybrid\",\n \"sources\": [\n \"chunks\"\n ],\n \"group_by\": \"match\",\n \"filters\": {},\n \"limit\": 10,\n \"neighbors\": 0,\n \"rerank\": \"auto\"\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.pnbr.io/v1/orgs/{org}/projects/{project}/files/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"mode\": \"hybrid\",\n \"sources\": [\n \"chunks\"\n ],\n \"group_by\": \"match\",\n \"filters\": {},\n \"limit\": 10,\n \"neighbors\": 0,\n \"rerank\": \"auto\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pnbr.io/v1/orgs/{org}/projects/{project}/files/search")
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 \"query\": \"<string>\",\n \"mode\": \"hybrid\",\n \"sources\": [\n \"chunks\"\n ],\n \"group_by\": \"match\",\n \"filters\": {},\n \"limit\": 10,\n \"neighbors\": 0,\n \"rerank\": \"auto\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"query": "<string>",
"mode_requested": "hybrid",
"mode_used": "hybrid",
"sources": [
"chunks"
],
"group_by": "match",
"ranking": {
"profile": "<string>",
"base_order": "<string>"
},
"results": [
{
"rank": 0,
"file": {
"id": "<string>",
"name": "<string>"
},
"version": {
"id": "<string>",
"number": 0
},
"match": {
"kind": "<string>",
"text": "<string>"
},
"scores": {
"base_rank": 0
},
"neighbors": [
{
"chunk_id": "<string>",
"chunk_index": 0,
"text": "<string>",
"location": {
"page": 0,
"section": "<string>",
"start_offset": 0,
"end_offset": 0,
"offset_unit": "<string>"
}
}
]
}
],
"groups": [
{
"file": {
"id": "<string>",
"name": "<string>"
},
"best_rank": 0,
"matches": [
{
"rank": 0,
"file": {
"id": "<string>",
"name": "<string>"
},
"version": {
"id": "<string>",
"number": 0
},
"match": {
"kind": "<string>",
"text": "<string>"
},
"scores": {
"base_rank": 0
},
"neighbors": [
{
"chunk_id": "<string>",
"chunk_index": 0,
"text": "<string>",
"location": {
"page": 0,
"section": "<string>",
"start_offset": 0,
"end_offset": 0,
"offset_unit": "<string>"
}
}
]
}
]
}
],
"candidate_count": 0,
"timing_ms": {
"total": 123
},
"warnings": [
{
"code": "<string>",
"detail": "<string>"
}
]
}
}Operation ID:
http.files.search
POST /v1/orgs/{org}/projects/{project}/files/search
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Maximum string length:
8192Available options:
hybrid, semantic, lexical Required array length:
1 - 2 elementsAvailable options:
chunks, moments Available options:
match, file Show child attributes
Show child attributes
Required range:
1 <= x <= 50Required range:
0 <= x <= 2Available options:
auto, off, required Response
2XX - application/json
Success.
Show child attributes
Show child attributes