# How to set up AI-text-generator

Under "Settings", locate "AI Assistant", then click "Text Generation".

<figure><img src="/files/4HsRXgCuIanQ2iiQFk7Q" alt=""><figcaption><p>Location of text generation settings.</p></figcaption></figure>

First, enable the text generation assistant. Then select your preferred OpenAI model.

After selecting the AI model, enter your "API key" and "Organization ID". Once completed, the screen should look similar to this:

<figure><img src="/files/c0mGOp6Tv7edjAPQDdcx" alt=""><figcaption><p>View of a correcly AI assistant setup.</p></figcaption></figure>

You can find your organization id by going to <https://platform.openai.com/settings/organization/general>


---

# 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.struct.com/tutorials/guides/how-to-use-ai-generated-text/how-to-set-up-ai-text-generator.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.
