retoor 8c18d54314 feat: add streaming response support to openai agent example
Updated the OpenAI agent example to demonstrate streaming responses by modifying the chat completion call to include `stream=True` and iterating over response chunks. Added a new `stream_response` function that yields tokens incrementally, showcasing real-time output for interactive use cases. The example now includes a `main` block that calls this function with a sample prompt, improving clarity for developers integrating streaming into their agents.
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%