POST
/
search
/
query_fanout
/
generate
import PiClient from 'withpi';

const client = new PiClient({
  apiKey: process.env['WITHPI_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.search.queryFanout.generate({
    query: 'Name the four largest fish and what they eat.',
  });

  console.log(response);
}

main();
[
  "<string>"
]

Authorizations

x-api-key
string
header
required

Body

application/json
query
string
required

The query to generate fanouts for

Example:

"Name the four largest fish and what they eat."

few_shot_examples
object[]

The list of few-shot examples for the fanout generation. Only needed if the default fanouts are not working well.

An input query and its associated fanout queries

Example:
[
  {
    "fanout_queries": [
      "Genus of the cheetah",
      "Genus of the pronghorn",
      "Genus of the springbok",
      "Genus of the wildebeest",
      "Genus of the lion"
    ],
    "query": "What are the genera of the five fastest land animals?"
  }
]
num_fanout_queries
integer
default:5

The number of fanout queries to generate

Example:

5

Response

200
application/json
Successful Response

The response is of type string[].