Creating a Structure from a GitHub Repo
=======================================

You can host your Gen AI Builder SDK :ref:`Augment Agents with Tools <Augment Agents with Tools>`  , :ref:`Pipelines </edb-postgres-ai/1.3/ai-factory/gen-ai/reference/sdk/structures/pipelines>`  , and
:ref:`Workflows </edb-postgres-ai/1.3/ai-factory/gen-ai/reference/sdk/structures/workflows>`  on Gen AI Builder. This allows you to run your Structures
without needing to manage infrastructure.

For production use-cases, we recommend connecting Gen AI Builder to
GitHub and storing the code for your Structures in one or more a GitHub
repos.

1. Connect Your GitHub Account in your Gen AI Builder account

2. Install the `Gen AI Builder GitHub app to your GitHub account or organization <https://github.com/apps/griptape-cloud/installations/new/>`_ 

   - Be sure to allow the app access to ``All Repositories`` or select
     the specific repositories you need

3. Ensure your repository has a Structure Config YAML file. If your
   repository contains multiple Structures, each Structure must have a
   separate Structure Config YAML file. - To learn more see
   :ref:`Structure Config YAML <Structure Config YAML>` 

4. Navigate to the Create Structure page in the Gen AI Builder Console

5. Select *Gen AI Builder Structure from GitHub Repo*

6. Select the GitHub Organization, Repository and Branch that you wish
   to deploy from.

7. Specify the ``structure_config.yaml`` for this deployment

8. Optionally, Enable Webhook and/or add Environment Variables

9. Click *Create* to create your Structure using the configuration
   details that you have entered

You can now create a Structure in the Gen AI Builder console by
providing your GitHub repository information.

Create a Structure from a ZIP file
----------------------------------

1. Ensure your Structure folder has a Structure Config YAML file. If
   your Structure folder contains multiple Structures, each Structure
   must have a separate Structure Config YAML file. - To learn more see
   :ref:`Structure Config YAML <Structure Config YAML>` 

2. Create a functional `Python venv <https://docs.python.org/3/library/venv.html>`_  in your Structure folder -
   Populating your virtual environment with your Structure’s Python
   dependencies can be done using `pip <https://pip.pypa.io/en/stable/getting-started/#install-multiple-packages-using-a-requirements-file>`_ 

3. Compress the entire Structure folder into a ZIP file

- On Mac and Linux systems, this can be done with the ‘zip’ CLI command
- On Windows systems, this can be done with the ‘tar.exe’ PowerShell
  command

4. Upload the created ZIP file to a :ref:`Data Lakes <Data Lakes>`  and note the Asset
   Name

5. Specify the ``structure_config.yaml`` for this deployment

6. Optionally, Enable Webhook and/or add Environment Variables

7. Click *Create* to create your Structure using the configuration
   details that you have entered

You can now create a Structure in the Gen AI Builder console by
providing your Bucket and Asset Name from above.

Quickstart With Samples and Templates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To get started with Structures in the Cloud, check out the
`managed-structure-template on GitHub <https://github.com/griptape-ai/managed-structure-template>`_  or deploy one of the `griptape-sample-structures from GitHub <https://github.com/griptape-ai/griptape-sample-structures/tree/main>`_  .
