square-codePython SDK

When to use: You are coding in Python, iterating from notebooks or applications, and want typed helpers during development.

Step 1: Install or Upgrade the Package

# Standard install (includes local execution)
pip install --upgrade "glaip-sdk[local]"

# Or install without local extra (remote execution only)
pip install --upgrade glaip-sdk

Step 2: Create and Run Your First Agent Locally

Ensure you installed glaip-sdk[local] and set your LLM provider key (for example OPENAI_API_KEY) before running locally.

from glaip_sdk import Agent

agent = Agent(
    name="hello-world-agent",
    instruction="You are a friendly AI assistant.",
)

response = agent.run("Hello! How are you today?")
print(response)

Step 3: Specify a Model (Optional)

By default, agents use openai/gpt-5-nano. You can specify a different model using the standardized provider/model format:

Step 4: Optional: Connect to AIP Server

If you want to run against the remote AIP server instead of using aip-agents locally, add your API details to a .env file:

When targeting the AIP server, call agent.deploy() once before running:

The SDK reads AIP_API_URL and AIP_API_KEY from the environment when deploying and running agents.

Optional Next Steps

Last updated

Was this helpful?