> For the complete documentation index, see [llms.txt](https://news-parser.gitbook.io/news-parser-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://news-parser.gitbook.io/news-parser-plugin/ai.md).

# AI

To use AI for generating content on your website, follow these instructions:

1. Set up the API Key: Open the `wp-config.php` file and add the following line to define your API key: `define('NEWS_PARSER_OPENAI_API_KEY', 'your_key')`. Please note that only OpenAI is supported as a provider, and other providers are not compatible. If you are using the free tier, also include `define('NEWS_PARSER_OPENAI_FREE_TIER', true)` to account for the limitations on the number of requests per minute. Failure to include this parameter will result in an error when using the OpenAI API.
2. Access the Visual Constructor: Go to the Visual Constructor within your website's admin panel.
3. Select the AI Provider: In the AI tab of the Visual Constructor, you will see a list of available AI providers. Choose the desired provider from the list.
4. Generate Post Title: In the Post Title section, check the "Generate using AI" option if you want to generate a new title for your post. Select the model and enter a prompt. Use `${title}` in the prompt wherever you want to insert the original title.
5. Generate Post Body: In the Post Body section, select the model for generating the post's content. Enter a prompt in the request field and use `${post}` where you want to include the original article's text and you can use tag `${title}` here as well.
6. Add Pipeline (Optional): If you need to modify the text using multiple requests, open the "Add Pipeline" tab. Enter the additional request text, which will automatically include the result of the previous request. Click "Add Prompt" to add this request to the pipeline. With the pipeline, you can ask the AI to review the results of the previous generation or request translation of the generated text into another language.
7. Apply AI Modifications: After configuring the AI settings for content modification, you can apply them immediately by selecting the content in the Visual Constructor and clicking the "Create Post" button. Alternatively, you can save these settings as a template for applying them during RSS parsing or when using the autopilot function.

{% hint style="info" %}
Please note that when using AI for content generation, it requires making API requests to the[ OpenAI API](https://openai.com/product), which will incur charges on your OpenAI account. Additionally, the AI generation process can take a significant amount of time.
{% endhint %}

By following these instructions, you can use artificial intelligence to create content for your website, whether it's parsing individual pages, parsing from RSS feeds, or using the autopilot function.

{% embed url="<https://youtu.be/jF3pYio7H9w>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://news-parser.gitbook.io/news-parser-plugin/ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
