Skip to content

docs: add module docstrings to example scripts#639

Open
Pawansingh3889 wants to merge 1 commit intoollama:mainfrom
Pawansingh3889:improve-example-docstrings
Open

docs: add module docstrings to example scripts#639
Pawansingh3889 wants to merge 1 commit intoollama:mainfrom
Pawansingh3889:improve-example-docstrings

Conversation

@Pawansingh3889
Copy link
Copy Markdown

Summary

Adds module-level docstrings to 8 example scripts explaining what each demonstrates, prerequisites (which model to pull), and how to run it.

Currently none of the examples have docstrings, which means newcomers have to read through the code to understand what each file does.

Files Changed

File Description Added
chat.py Basic chat completion
generate.py Basic text generation
embed.py Text embeddings
tools.py Tool/function calling
structured-outputs.py Pydantic-validated JSON output
chat-stream.py Streaming responses
chat-with-history.py Multi-turn conversation
multimodal-chat.py Image + text input

Format

Each docstring follows the same structure:

  1. One-line summary
  2. Brief explanation
  3. Prerequisites (model to pull, extra deps)
  4. Usage command

Test Plan

  • Documentation only, no logic changes

Adds descriptive docstrings to 8 example files explaining what each
demonstrates, prerequisites (which model to pull), and how to run it.

Files: chat.py, generate.py, embed.py, tools.py, structured-outputs.py,
chat-stream.py, chat-with-history.py, multimodal-chat.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant