| Example | Description |
|---|---|
| Access Memories in Memory Completed Event | Stream an agent run with stream_events=True and read user memories off the MemoryUpdateCompleted event, backed by PostgresDb. |
| Chat Agent Flex Tier | Run o4-mini on the flex service tier by setting service_tier on OpenAIChat. |
| OpenAI Audio Input Agent | Send a WAV file fetched from a URL to gpt-audio and stream a text answer about it. |
| OpenAI Audio Input And Output Multi Turn | Send audio input to gpt-audio and carry the conversation across turns with audio replies. |
| OpenAI Audio Input Local File Upload | Upload a local MP3 file to gpt-audio and get a text description of the audio. |
| OpenAI Audio Output Agent | Get text and audio output from gpt-audio and save each spoken reply to a WAV file. |
| OpenAI Audio Output Stream | Stream pcm16 audio from gpt-audio, printing the transcript while writing frames to a WAV file. |
| Chat Basic | Run a gpt-4o agent in sync, async, and streaming modes with OpenAIChat. |
| OpenAI Basic Stream Metrics | Stream a response, then read run-level and per-message metrics from the last run output. |
| Custom Role Map | Point OpenAIChat at Mistral’s base_url and remap the model role to assistant via role_map. |
| Chat DB | Store session history in Postgres so a follow-up question can reference the previous answer. |
| OpenAI Generate Images | Legacy DalleTools example that generates an image and reads its URL from the run output. |
| Chat Image Agent | Analyze an image from a URL and search the web for related news, streaming the reply. |
| Chat Image Agent Bytes | Pass an image as raw bytes and combine vision with web search for current news. |
| Chat Image Agent with Memory | Analyze an image with web search, keeping chat history so follow-ups can reference it. |
| Chat Knowledge | Load a PDF into PgVector-backed knowledge and answer questions from its contents. |
| Chat Memory | Store user memories and session summaries in Postgres and print them after each turn. |
| OpenAI Metrics | Print per-message and aggregated run metrics after a YFinance tool call. |
| PDF Input File Upload | Attach a local PDF file to an OpenAI chat agent and ask it to suggest a recipe from the document. |
| Chat PDF Input Local | Attach a local PDF by filepath and query its contents with gpt-4o. |
| Chat PDF Input URL | Attach a PDF by URL and ask the agent for a recipe from the file. |
| Chat Reasoning O3 Mini | Run o3-mini with high reasoning effort and YFinance tools to write a stock report. |
| Retry | Review retry settings and why invalid model IDs cannot reliably exercise the retry path. |
| Chat Structured Output | Compare JSON mode, strict, and guided structured output for a Pydantic movie schema. |
| Text-to-Speech Agent | Generate speech with the OpenAITools speech toolkit and save the returned audio to tmp/speech_output.mp3. |
| Chat Tool Use | Answer questions with web search tools in sync, streaming, and async modes. |
| Chat Verbosity Control | Control response length with the gpt-5 verbosity parameter in a finance report agent. |
| OpenAI With Retries | Review retry settings and why invalid model IDs cannot reliably exercise the retry path. |
Chat
OpenAI Chat examples for multimodal input and output, tools, reasoning, structured output, storage, and retries.