POST
/
data
/
cluster_inputs
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.data.clusterInputs({
    inputs: [{ identifier: 'abcd12345', llm_input: 'The lazy dog was jumped over by the quick brown fox' }],
  });

  console.log(response);
}

main();
[
  {
    "inputs": [
      "<string>"
    ],
    "topic": "Coding questions"
  }
]

Authorizations

x-api-key
string
header
required

Body

application/json
inputs
object[]
required

The data to create clusters from.

Example:
[
  {
    "identifier": "abcd12345",
    "llm_input": "The lazy dog was jumped over by the quick brown fox"
  }
]
num_clusters
integer | null

The number of clusters to form. If none, the api chooses a number automatically.

Example:

5

Response

200
application/json
Successful Response
inputs
string[]
required

The input IDs assigned to this topic

topic
string
required

The topic of the input in this cluster

Example:

"Coding questions"