retoor cae85929bc feat: add streaming response support to openai agent example with stream=True and token iteration
Added a new `stream_response` function that yields tokens incrementally by setting `stream=True` on the chat completion call and iterating over response chunks. The example now includes a `main` block that calls this function with a sample prompt, demonstrating real-time output for interactive use cases. Also fixed grammar and punctuation in docstrings, corrected the pip install package name from `openapi` to `openai`, and improved clarity of setup instructions.
2024-12-20 19:00:20 +00:00

Examples / research

This is a collection of source code examples and research that I share with others online. Not all is written by me. It's also used for just sharing resources on discussion forums. The contents are mainly destined to be read by a software developer.

Do you see something you want to know more about? Contact retoor@molodetz.nl.

S
Description
Information I want to share with other people.
Readme
1.3 MiB
Languages
Python 86.7%
C 8.7%
HTML 2.8%
JavaScript 1.5%
Shell 0.3%