Code for my 31-day AI agent challenge on YouTube, recorded in March 2024. Each day_* folder is a standalone project, mostly built on AutoGen 0.2 (pyautogen), with some LangChain, LM Studio, Ollama and Hugging Face days.
Join my Discord community for any questions.
Legacy code (2024). This repo matches the videos and is not updated. OpenAI shut down
gpt-3.5-turbo,gpt-4andgpt-4-vision-preview, which most OpenAI days use, so those days fail withmodel_not_founduntil you change the model name. See Models used in this repo were retired.
Each day pins its own dependencies, so install per folder:
cd day_02_logging
pip install -r requirements.txt
python main.pyUse Python 3.11 or 3.12. The pinned pyautogen 0.2 releases require Python below 3.13, and pins such as numpy==1.26.4 and torch==2.2.1 publish wheels only up to 3.12.
Days that pin chromadb==0.4.24 need Python 3.11, because its chroma-hnswlib==0.7.3 dependency has no Python 3.12 wheel. On 3.12, pip tries to compile it and needs a C++ compiler. Those days are 15, 16, 18, 19, 20, 23, 24, 25 and 30.
day_17 has no code. It only links the AutoGen video it reacts to.
Days that call OpenAI read the key from an OAI_CONFIG_LIST.json (or .env) in that folder. Replace the placeholder api_key with your own key; never commit a real one.
These models have been shut down. The substitutes are the ones listed on the OpenAI deprecations page and the Anthropic deprecations page:
| Model in this repo | Shut down | Substitute |
|---|---|---|
gpt-3.5-turbo |
2026-10-23 | gpt-5.6-terra |
gpt-4, gpt-4-1106-preview |
2026-10-23 | gpt-5.6-sol |
gpt-4-vision-preview |
2024-12-06 | a current vision model, e.g. gpt-5.6-terra |
claude-3-sonnet-20240229 (day 28) |
2025-07-21 | claude-sonnet-5-5 |
gpt-5.4-mini is a cheaper option for these small demos ($0.75 / $4.50 per 1M input/output tokens, against $2 / $12 for gpt-5.6-terra and $4 / $20 for gpt-5.6-sol).
To run an affected day:
- Change the model name everywhere that day sets it:
"model"inOAI_CONFIG_LIST.json,MODEL=in.env, and anyfilter_dict,model=oros.environ["model"]in its.pyfiles (search the folder forgpt-). - Delete
"temperature"and"max_tokens"from thellm_config. GPT-5 models only accept the default temperature, and usemax_completion_tokensinstead ofmax_tokens. For LangChainChatOpenAI(...)calls (days 09 and 24), settemperature=1instead of deleting it: the pinnedlangchain-openai==0.0.8sendstemperature=0.7whenever you leave it out. - Expect a cost-calculation warning from
pyautogen0.2: its price table predates these models. The chat still runs.
Days 19 and 20 also build LangChain's OpenAI() class with no model name. That class calls the legacy Completions endpoint and defaults to gpt-3.5-turbo-instruct, which OpenAI shut down on 2026-09-28. The suggested substitutes (gpt-5.6-terra, gpt-5.4-mini) do not support that endpoint, so changing a model name is not enough there (and os.environ["model"] in day 19 is never read). Replace the import and the call:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-5.4-mini", temperature=1) # instead of OpenAI(...)RetrievalQA (day 19) and ConversationalRetrievalChain (day 20) accept a chat model unchanged. Day 30 uses the same OpenAI() class but points it at a local LM Studio server through BASE_URL, so it is not affected.
Day 28 (claude.py) calls the Anthropic Messages API directly, so the GPT steps above do not cover it. Two changes are needed besides the model name:
- Delete
temperature=0.0fromclient.messages.create(...).claude-sonnet-5-5returns a 400 error when a request setstemperature,top_portop_k(model page). - Print only the text blocks. Adaptive thinking is on by default on this model, so
message.content[0]can be athinkingblock with no text. Replace the lastprintwith:
print("".join(block.text for block in message.content if block.type == "text"))Thinking tokens count toward max_tokens, so keep max_tokens=4096 or raise it. main.py talks to Claude through a LiteLLM proxy at 0.0.0.0:4000, so change the model in the proxy's config as well. The zephyr config in claude.py points at LM Studio on localhost:1234 and only borrows the Claude name; it is not affected.
Days that reference a retired model: 01, 02, 03, 05, 08, 09, 10, 11, 13, 16, 18, 19, 20, 21, 22, 23, 24, 25, 28 and 29 (web search). Days 04, 06 and 27 run local models through LM Studio or Ollama and are not affected.
For current, maintained AutoGen code (AutoGen 0.7 API), see tylerprogramming/ai.