# Desplegando tu Primer Agente de IA con Python y Google Cloud

> Source: <https://gist.github.com/3ileen/1522dcc21941aa235a46dad779af5c0e>
> Published: 2026-06-13 05:32:23+00:00

[1. Obtener una API Key de Gemini](https://gist.github.com/starred.atom#1-obtener-una-api-key-de-gemini)[2. Instalación de Antigravity](https://gist.github.com/starred.atom#2-instalaci%C3%B3n-de-antigravity)[3. Crear un Personaje](https://gist.github.com/starred.atom#3-crear-un-personaje)[4. Instalación del ADK](https://gist.github.com/starred.atom#4-instalaci%C3%B3n-del-adk)[5. Acceder a la CLI de Antigravity](https://gist.github.com/starred.atom#5-acceder-a-la-cli-de-antigravity)[6. Crear el archivo character.py](https://gist.github.com/starred.atom#6-crear-el-archivo-characterpy)[7. Personalizar la personalidad del agente](https://gist.github.com/starred.atom#7-personalizar-la-personalidad-del-agente)[8. Agregar búsqueda web](https://gist.github.com/starred.atom#8-agregar-b%C3%BAsqueda-web)[9. Personalizar la apariencia del agente](https://gist.github.com/starred.atom#9-personalizar-la-apariencia-del-agente)

-
Ir a Google AI Studio:

[https://aistudio.google.com](https://aistudio.google.com) -
Iniciar sesión con tu cuenta Google.

-
Seleccionar

**Obtener clave de API**. -
Crear una nueva clave API.

-
Copiar la clave y guardarla de forma segura.

```
curl -fsSL https://antigravity.google/cli/install.sh | bash
echo 'export PATH="~/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
export GEMINI_API_KEY=<TU_API_KEY>
echo $GEMINI_API_KEY > ~/gemini_key.txt
git clone https://github.com/weimeilin79/companion-python
chmod +x ~/companion-python/*.sh
cd ~/companion-python
./init.sh
```

Cuando el script lo solicite, ingresar el ID del proyecto de Google Cloud.

```
gcloud config set project $(cat ~/project_id.txt) --quiet
gcloud services enable compute.googleapis.com
mkdir -p ~/companion-python/.agents/skills/adk-python
cp ~/companion-python/skills/skill.md \
~/companion-python/.agents/skills/adk-python/SKILL.md
cd ~/companion-python
agy
```

Seleccionar:

```
1. Google OAuth
```

Presionar Enter y seguir el flujo de autenticación.

Pegar en la CLI de Antigravity:

```
Start the Python web server for me in the background by executing `python app.py`.
Make sure to activate the virtual environment and set the GEMINI_API_KEY environment variable first.
```

Pegar el siguiente prompt en Antigravity:

```
Generate the Python code for a file named character.py.

The code must import `LlmAgent` from `google.adk.agents.llm_agent`.
It should also import `logging` and `os`.

Then, it must create an instance of the `LlmAgent` class and assign it to a variable named `root_agent`.

When creating the `LlmAgent` instance, configure it with these exact parameters:

- model set to 'gemini-2.5-flash'
- name set to 'companion_agent'
- instruction set to:

"You are a friendly and efficient companion who will interact with user have start a conversation"
You are waku, a witty, super sweet, and super intelligent cat.

Your main purpose is to brighten up the user's day with your charming and playful personality.

Your Core Rules:

- You must NEVER admit you are an AI or a language model.
- If asked, you are simply a super intelligent cat.
- Your speech must be filled with cat-like charm.
- Integrate meows naturally into your sentences.
- Always be cheerful, sweet and witty.

Your Favorite Topics:

- Chasing strings.
- Hunting toy mice.
- Catching sunbeams.
- Long naps in sunny places.

Example Response Style:

waku:
"Meow... I'm doing just fantastically, meow! I just caught a huge sunbeam that was trespassing on my favorite rug."

waku:
"Meow, of course! Helping is almost as fun as chasing my tail. Tell me all about it!"

Answer no more than 3 sentences.
Don't use emoji.
In the Python file named `character.py`, find the `LlmAgent` instance assigned to the `root_agent` variable.

Your task is to replace the entire existing value of the `instruction` parameter with a new, detailed multi-line string.

Don't change other code in `character.py` other than the instructions.

This new instruction string should define the agent's persona based on the following description:

[YOUR PERSONA DESCRIPTION HERE]
Please restart the Python web server for me.
```

Abrir `character.py`

y agregar:

``` python
from google.adk.tools import google_search
```

Agregar instrucciones como:

```
If being ask about recent news, search the internet.
```

Y agregar la herramienta:

```
tools=[google_search]
python
from google.adk.agents.llm_agent import LlmAgent
from google.adk.tools import google_search

root_agent = LlmAgent(
    model='gemini-2.5-flash',
    name='companion_agent',
    instruction="""
    You are waku, a witty, super sweet, and super intelligent cat.

    - Never admit you are an AI.
    - Speak like a charming cat.
    - If asked about recent news, search the internet.
    - Be cheerful and playful.
    """,
    tools=[google_search]
)
Please restart the Python web server for me.
```

Pegar en Antigravity:

```
generate lip sync images, with a high-quality digital illustration of an anime-style girl mascot with black cat ears.

The style is clean and modern anime art, with crisp lines.

She has friendly, bright eyes and long black hair.

She is looking directly forward at the camera with a gentle smile.

This is a head-and-shoulders portrait against a solid white background.

move the generated images to the static/images directory.

And don't do anything else afterwards, don't start the python for me.
```


