From 4c2bab8832d952a439b44edcea2dc6caff5ba792 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Wed, 4 Nov 2026 14:38:17 +0100 Subject: [PATCH] fix: pin the hello_llm tutorial to a current OpenAI model OpenAI has deprecated gpt-3.5-turbo, which is the LlamaIndex OpenAI default, so the tutorial's LLM call returns 404 model_not_found and the smoke test fails. Pass the model explicitly (gpt-4o-mini) and document why in the tutorial prose. --- docs/examples/tutorials/more-components.md | 1 + examples/tutorials/003_more_components/hello_llm.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/examples/tutorials/more-components.md b/docs/examples/tutorials/more-components.md index 17d378ba..729f9648 100644 --- a/docs/examples/tutorials/more-components.md +++ b/docs/examples/tutorials/more-components.md @@ -45,6 +45,7 @@ We're going to use the [`LLMChat`][plugboard.library.LLMChat] to access OpenAI: 1. `LLMChat` can use [structured output](https://docs.llamaindex.ai/en/stable/understanding/extraction/structured_llms/) to process the LLM response into a known format. Here we define a Pydantic model that specifies everything we're expecting back. 2. Setting `expand_response = True` will unpack `location`, `latitude` and `longitude` into separate outputs on the component. +3. The LLM model is passed explicitly: LlamaIndex's default (`gpt-3.5-turbo`) has been [deprecated by OpenAI](https://platform.openai.com/docs/deprecations), so always specify a current model. !!! info To run this tutorial you'll need an API key for [OpenAI](https://platform.openai.com/docs/quickstart). Set the `OPENAI_API_KEY` environment variable to provide it to the model. diff --git a/examples/tutorials/003_more_components/hello_llm.py b/examples/tutorials/003_more_components/hello_llm.py index d2305c97..8c015a4c 100644 --- a/examples/tutorials/003_more_components/hello_llm.py +++ b/examples/tutorials/003_more_components/hello_llm.py @@ -72,6 +72,7 @@ async def main() -> None: system_prompt="Identify a geographical location from the input and provide its latitude and longitude", response_model=Location, expand_response=True, # (2)! + llm_kwargs={"model": "gpt-4o-mini"}, # (3)! ) # --8<-- [end:llm] # --8<-- [start:weather]