[PR #13507] [CLOSED] Fix: NameError in Python example in docs/capabilities/streaming.mdx #19514

Closed
opened 2026-04-16 07:09:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13507
Author: @j0m0k0
Created: 12/17/2025
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • c74e37c Fix syntax for new_messages object in streaming.mdx (Python example)

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 docs/capabilities/streaming.mdx (+2 -2)

📄 Description

In the Python example in here, the dictionary created within the new_messages raises NameError and prevents the program from running. The problem is that quotations for the keys of that dictionary is forgotten. Therefore, when you run this example, it will throw NameError: name 'role' is not defined.

The fix is simple though, by just adding quotations around the dictionary keys, the problem will be fixed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13507 **Author:** [@j0m0k0](https://github.com/j0m0k0) **Created:** 12/17/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`c74e37c`](https://github.com/ollama/ollama/commit/c74e37ce4adea3a8c015dfe7282b4ac9b1850511) Fix syntax for new_messages object in streaming.mdx (Python example) ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/capabilities/streaming.mdx` (+2 -2) </details> ### 📄 Description In the Python example in [here](https://docs.ollama.com/capabilities/streaming), the dictionary created within the `new_messages` raises `NameError` and prevents the program from running. The problem is that quotations for the keys of that dictionary is forgotten. Therefore, when you run this example, it will throw `NameError: name 'role' is not defined`. The fix is simple though, by just adding quotations around the dictionary keys, the problem will be fixed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:09:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#19514