# OpenAI (beta)

Now, we allow you to integrate OpenAI as an assisted labeling tool for your projects. With this integration, you can easily select OpenAI from the provider dropdown menu.

#### Sample Data

We also provide a sample for you to try on your own project. You can simply upload the document as your input data and the question set as your question to be answered.

After successfully creating the project, you need to activate the ML-assisted labeling extension and select OpenAI as the provider. Once you have chosen OpenAI, you can access several fields under the OpenAI extension. These fields include:

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-4f055ce6c5afd5cb74526e9861dd10ea95e510ed%2Fimage%20(2)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption><p>Sample project with OpenAI integration</p></figcaption></figure>

1. Target text: define your text column that is going to be treated as input
2. Target question: your selected question to be answered
3. API token: the OpenAI secret key
4. System prompt: introduction prompt to define the OpenAI agent role
5. User prompt: user definition of a task to be completed in a specific labeling workflow.

{% hint style="info" %}
You can refer to [these examples of prompt templates](https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/llm-assisted-labeling/prompt-examples) for guidance.
{% endhint %}

In addition, you can specify your desired output through instructions and examples.

Once all fields have been filled, you can predict the label by clicking “Predict label”.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-0024248bc19d2f7d412ea41f051000a65bfca1ae%2Fimage%20(3)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

The labels will then be automatically applied to the corresponding line.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-592933568400fd8a97fb3eb0363d25f9f3a16e28%2Fimage%20(4)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption><p>Result with Open AI ML Assisted</p></figcaption></figure>

{% hint style="info" %}
If you are experiencing the 429 error, the limitation came from the OpenAI package. Please take a look at your current usage of OpenAI API.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datasaur.ai/assisted-labeling/ml-assisted-labeling/openai-beta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
