# How Custom Functions Work (Legacy)

{% embed url="<https://youtu.be/zA5kDFzo-fE>" %}

**How to Create a New Custom Function:**

1. Use ChatGPT to generate the code needed
2. Create a new Google Cloud Project to connect with generated code
3. Test to make sure code is working
4. Create AI agent with custom function

***

*Custom Functions are an advanced feature only available to Full SaaS Mode subscribers.*

This is advanced functionality we are sharing with full SaaS mode users early to help test and improve UI/ UX.

Custom Functions allow developers to create custom actions and API calls for their AI agents similar to creating a custom GPT.

For example: “I want to create an AI agent that is connected to my Shopify inventory and provide live availability.”

You could create a custom function which connects your Shopify store and gets all the data as needed for your use case so the AI agent can respond as needed.

### What is a Custom Function?

A custom function is a process that allows an AI agent in Stammer to interface with 3rd party data.&#x20;

Example: An AI agent is trained to know about the stock market. It will ask the user what stock symbol they are interested to know the current ticket price for. The AI agent has a custom function that is connected to a 3rd party API. It will pass the user's answer through the custom function to respond back to the user and receive the live price data.

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


---

# 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.stammer.ai/stammer.ai-docs/chat-ai-agents/functions-labs/custom-functions-legacy/how-custom-functions-work-legacy.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.
