Implement Custom Search In GPT-3



Original Source Here

Custom Search Using Provided Documents

In the example below we are going to follow a two-step process where we are going to upload a data file and then have search results yielded based on this file.

{"text": "puppy A is happy", "metadata": "emotional state of puppy A"}{"text": "puppy B is sad", "metadata": "emotional state of puppy B"}

Our search file or document only has two lines, where we have a text entry, with meta data.

OpenAI is installed using pip. Python is used to mount a Google Drive and access the training file. The training process is initiated.

Next, we upload this file using the files API. After running pip install to install openai, you see the simplest possible way to upload search documents.

Perhaps only apart from cURL.

OpenAI is installed using pip.

Python is used to mount a Google Drive and access the training file.

The training process is initiated.

If something is wrong with your Python code, a 400 or 401 error will be returned.

A successful return message is shown here below.

Most importantly the file ID is given, which can be used to reference the search data.

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: