# Bricks for AI

With so many use cases for Artificial Intelligence (AI) and Large Language Models (LLMs) these days, you'll likely want to incorporate AI in your mod. We have a couple bricks you can use to do that.&#x20;

### Chat with ChatGPT

To interact with OpenAI in PixieBrix, you can use the **Create Chat Response with ChatGPT** brick.&#x20;

The most important settings are:

* **OpenAI Configuration**: use our built-in one, or [add your own OpenAI integration](/integrations/openai-chatgpt.md)
* **Model**: select from a model, including gpt-4.0
* **Messages**: define system and user prompts

<figure><img src="/files/8nYnn21BJOAggg06jDtb" alt=""><figcaption></figcaption></figure>

Below that are additional settings you can change, but you can typically use the defaults unless you need to change something.

<figure><img src="/files/cyzN8rVr5Af2MhLXPoVm" alt=""><figcaption></figcaption></figure>

Learn more by reading the [Create Chat Responses with ChatGPT brick docs](https://www.pixiebrix.com/marketplace/a3f44286-89c1-4a14-b6bb-4512cbfde425/?utm_source=pixiebrix\&utm_medium=page_editor\&utm_campaign=docs\&utm_content=view_docs_link).

### Few Shot Prompting with ChatGPT&#x20;

If you're trying to do something very specific and want to train your brick, use the Few Shot Prompt brick to provide examples of expected output from your provided inputs.&#x20;

<figure><img src="/files/XqzunInMWcIuJwmedXih" alt=""><figcaption></figcaption></figure>

Learn more in the [Few Shot Prompt brick docs](https://www.pixiebrix.com/marketplace/1e212b34-84e9-4903-a983-a5842a6dce22/).

### Chat with PaLM

We also have a few bricks for working with PaLM, Google's LLM.&#x20;

* [Create Chat Response with PaLM](https://www.pixiebrix.com/marketplace/eea3eb03-8fed-40ba-8683-7b63bda5d115/)
* [Create Text Response with PaLM](https://www.pixiebrix.com/marketplace/79905671-2ca8-4ac3-9c84-c4ee3d23287f/)
* [Parse/Repair PaLM JSON Response](https://www.pixiebrix.com/marketplace/4c34922f-58fc-49f1-b779-2cdcfe9ae41f/)

### Custom AI models

If you'd like to work with a model that we don't already have a brick for, you can use the HTTP Request brick to integrate with any model that has an API.&#x20;

Learn more about [creating integrations](/integrations.md) and [working with APIs](/developing-mods/developer-concepts/working-with-apis.md) in PixieBrix.


---

# 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.pixiebrix.com/developing-mods/developer-concepts/using-bricks/bricks-for-ai.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.
