import PiClient from 'withpi';const client = new PiClient({ apiKey: 'My API Key',});const response = await client.search.rank({ passages: ['string'], query: 'query' });console.log(response);
Copy
[ 123]
Search
Pi Ranking
Rank passages based on their relevance to a query. This will return a score for each passage indicating its relevance to the query.
Scores are returned in the same order as the input passages.
POST
/
search
/
query_to_passage
/
score
JavaScript
Copy
import PiClient from 'withpi';const client = new PiClient({ apiKey: 'My API Key',});const response = await client.search.rank({ passages: ['string'], query: 'query' });console.log(response);