> For the complete documentation index, see [llms.txt](https://docs.pixiebrix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pixiebrix.com/developing-mods/developer-concepts/using-bricks/bricks-for-ai.md).

# 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.

### Chat with ChatGPT

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

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="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2F08Bk5vLMk9dE23ELFSl0%2Fimage.png?alt=media&amp;token=542e30ec-8aa2-452d-91d3-47b66dfe174c" 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="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FyeZrHHVQiLrLivEiwUC5%2Fimage.png?alt=media&amp;token=1b5b1f1b-cb0e-4504-b896-a0f6c4744cc0" alt=""><figcaption></figcaption></figure>

### Few Shot Prompting with ChatGPT

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.

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FMPzHAuEkjlpm8f7ea7vU%2Fimage.png?alt=media&amp;token=5012111b-47b6-4f40-8d7e-42417a04bfd9" alt=""><figcaption></figcaption></figure>

### Chat with PaLM

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

* Create Chat Response with PaLM
* Create Text Response with PaLM
* Parse/Repair PaLM JSON Response

### 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.

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


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pixiebrix.com/developing-mods/developer-concepts/using-bricks/bricks-for-ai.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
