You can authorize HTTP requests by passing the keys in via headers. The secret key goes in as the “secret” header.
With the client libraries, you can pass the key in once and then all requests are automatically authenticated.
import pongo#Replace the key with your actual API keypongo_client = pongo.PongoClient(PONGO_SECRET_KEY)query ="What color are apples?"#pass in the top ~50-100 results from your existing pipeline, passing more results will catch more edge cases but take longer to processresults_to_filter =[{"id":1,"text":"Oranges are orange","metadata":{}},{"id":2,"text":"Apples can be red or green","metadata":{}},{"id":3,"text":"Grapes can be purple or green","metadata":{}},{"id":4,"text":"Banannas are yellow","metadata":{}}]pongo_result = pongo_client.filter(docs=results_to_filter, query=query, num_results=10, public_metadata_field="metadata", key_field="id", text_field='text')#List of the 10 most relevant documents to the queryfiltered_docs = pongo_result.json()