Skip to content

Commit 35c3d46

Browse files
Copilotpamelafox
andcommitted
Update AGENTS.md with agent-facing LLM provider checks and remove dependency upgrade section
Co-authored-by: pamelafox <[email protected]>
1 parent a0cd0cc commit 35c3d46

File tree

1 file changed

+57
-93
lines changed

1 file changed

+57
-93
lines changed

AGENTS.md

Lines changed: 57 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -160,79 +160,80 @@ The scripts read environment variables from a `.env` file. Create one based on y
160160

161161
#### Option 1: GitHub Models (RECOMMENDED for agents)
162162

163-
In GitHub Codespaces, `GITHUB_TOKEN` is already set, so **no .env file is needed** - scripts will work immediately.
163+
**For agents:** Check if `GITHUB_TOKEN` environment variable is available:
164+
```bash
165+
if [ -n "$GITHUB_TOKEN" ]; then
166+
echo "GitHub Models available - GITHUB_TOKEN is set"
167+
else
168+
echo "GitHub Models not available - GITHUB_TOKEN not found"
169+
fi
170+
```
164171

165-
For local development:
166-
1. Create a GitHub Personal Access Token (no scopes needed): https://github.com/settings/tokens
167-
2. Set the environment variable:
168-
```bash
169-
export GITHUB_TOKEN=your_personal_access_token
170-
```
171-
Or create a `.env` file:
172-
```bash
173-
cp .env.sample.github .env
174-
# Edit .env and set GITHUB_TOKEN
175-
```
172+
In GitHub Codespaces, `GITHUB_TOKEN` is already set, so **no .env file is needed** - scripts will work immediately.
176173

177-
3. Optionally set a different model (default is `gpt-4o`):
178-
```bash
179-
export GITHUB_MODEL=openai/gpt-4o-mini
180-
```
174+
If `GITHUB_TOKEN` is available, you can optionally set a different model (default is `gpt-4o`):
175+
```bash
176+
export GITHUB_MODEL=openai/gpt-4o-mini
177+
```
181178

182179
**Models that support function calling:** `gpt-4o`, `gpt-4o-mini`, `o3-mini`, `AI21-Jamba-1.5-Large`, `AI21-Jamba-1.5-Mini`, `Codestral-2501`, `Cohere-command-r`, `Ministral-3B`, `Mistral-Large-2411`, `Mistral-Nemo`, `Mistral-small`
183180

184181
#### Option 2: Azure OpenAI (requires Azure resources and costs)
185182

186-
1. Install Azure Developer CLI: https://aka.ms/install-azd
187-
2. Login to Azure:
188-
```bash
189-
azd auth login
190-
# Or for Codespaces: azd auth login --use-device-code
191-
```
192-
3. Provision resources (creates resource group, OpenAI account, deploys gpt-4o and text-embedding-3-small):
193-
```bash
194-
azd provision
195-
```
196-
This will:
197-
- Prompt for environment name (e.g., "agents-demos")
198-
- Prompt for subscription
199-
- Prompt for location
200-
- Create Azure resources using `infra/main.bicep`
201-
- Automatically run `infra/write_dot_env.sh` (or `.ps1` on Windows) to create `.env`
183+
**For agents:** Check if Azure OpenAI environment variables are already configured:
184+
```bash
185+
if [ -n "$AZURE_OPENAI_ENDPOINT" ] && [ -n "$AZURE_OPENAI_CHAT_DEPLOYMENT" ]; then
186+
echo "Azure OpenAI available - required environment variables are set"
187+
else
188+
echo "Azure OpenAI not available - missing AZURE_OPENAI_ENDPOINT or AZURE_OPENAI_CHAT_DEPLOYMENT"
189+
fi
190+
```
202191

203-
4. After provisioning, the `.env` file will be created automatically with all needed variables.
192+
If Azure OpenAI variables are not available, an administrator would need to provision Azure resources using:
193+
```bash
194+
azd auth login
195+
azd provision
196+
```
204197

205-
5. To clean up resources:
206-
```bash
207-
azd down
208-
```
198+
This creates real Azure resources that incur costs. The `.env` file would be created automatically with all needed variables after provisioning.
209199

210200
#### Option 3: OpenAI.com (requires API key and costs)
211201

202+
**For agents:** Check if OpenAI.com API key is available:
212203
```bash
213-
cp .env.sample.openai .env
214-
# Edit .env and set:
215-
# API_HOST=openai
216-
# OPENAI_API_KEY=your_openai_api_key
217-
# OPENAI_MODEL=gpt-4o-mini
204+
if [ -n "$OPENAI_API_KEY" ]; then
205+
echo "OpenAI.com available - OPENAI_API_KEY is set"
206+
else
207+
echo "OpenAI.com not available - OPENAI_API_KEY not found"
208+
fi
218209
```
219210

211+
If `OPENAI_API_KEY` is available, ensure `API_HOST=openai` and `OPENAI_MODEL` are also set (e.g., `gpt-4o-mini`).
212+
220213
#### Option 4: Ollama (requires local Ollama installation)
221214

222-
1. Install Ollama: https://ollama.com/
223-
2. Pull a model:
224-
```bash
225-
ollama pull llama3.1
226-
```
227-
3. Create .env:
228-
```bash
229-
cp .env.sample.ollama .env
230-
# Edit .env and set:
231-
# API_HOST=ollama
232-
# OLLAMA_ENDPOINT=http://localhost:11434/v1
233-
# OLLAMA_MODEL=llama3.1
234-
```
235-
**Important:** If running in a Dev Container, use `http://host.docker.internal:11434/v1` instead of `localhost`.
215+
**For agents:** Check if Ollama is installed and running:
216+
```bash
217+
if command -v ollama &> /dev/null; then
218+
echo "Ollama command found"
219+
ollama list
220+
if [ $? -eq 0 ]; then
221+
echo "Ollama is running and available"
222+
else
223+
echo "Ollama installed but not running"
224+
fi
225+
else
226+
echo "Ollama not installed"
227+
fi
228+
```
229+
230+
If Ollama is available, configure the environment:
231+
```bash
232+
# API_HOST=ollama
233+
# OLLAMA_ENDPOINT=http://localhost:11434/v1
234+
# OLLAMA_MODEL=llama3.1
235+
```
236+
**Important:** If running in a Dev Container, use `http://host.docker.internal:11434/v1` instead of `localhost`.
236237

237238
### Running Scripts
238239

@@ -302,43 +303,6 @@ python spanish/chat.py
302303

303304
**Note:** Most scripts are demonstration scripts, not unit-tested. Changes to scripts should be manually verified by running them.
304305

305-
## Upgrading Python Dependencies
306-
307-
This repository uses **standard pip** for dependency management (not poetry, pipenv, or uv for installation).
308-
309-
### To upgrade a single dependency:
310-
311-
```bash
312-
# Activate your virtual environment first
313-
source .venv/bin/activate
314-
315-
# Upgrade a specific package
316-
python -m pip install --upgrade package-name
317-
318-
# Update requirements file manually to reflect the new version
319-
```
320-
321-
### To upgrade all dependencies:
322-
323-
```bash
324-
# Activate your virtual environment
325-
source .venv/bin/activate
326-
327-
# Upgrade all packages
328-
python -m pip install --upgrade -r requirements.txt
329-
python -m pip install --upgrade -r requirements-rag.txt
330-
331-
# Freeze to see new versions (optional)
332-
python -m pip freeze
333-
```
334-
335-
### Important Notes:
336-
337-
1. **The CI uses `uv` for speed**, but you should use standard `pip` for local development unless you have `uv` installed.
338-
2. After upgrading dependencies, always test by running the linters and at least a few example scripts.
339-
3. The `openai` package has a minimum version constraint: `openai>=1.108.1` in requirements.txt. Don't downgrade below this.
340-
4. If upgrading `openai`, check for breaking API changes in their changelog.
341-
342306
## Important Notes and Gotchas
343307

344308
### Environment Variables

0 commit comments

Comments
 (0)