Skip to content

Conversation

Abbas-Asad
Copy link
Contributor

Summary

Added a missing docstring to the get_weather function (in README.md) in Functions example to improve code documentation and tool description.

Problem

The get_weather function in README.md was missing a proper docstring, which is important for:

  • Clear function documentation and readability
  • Helping language models understand the tool's purpose and when to use it
  • Following Python best practices for function documentation

Changes Made

Added a concise, one-line docstring to the get_weather function in README.md:

@function_tool
def get_weather(city: str) -> str:
    """Get the current weather for a given city."""
    return f"The weather in {city} is sunny."

## Summary

Added a missing docstring to the `get_weather` function (in `README.md`) in Functions example to improve code documentation and tool description.


## Problem

The `get_weather` function in `README.md` was missing a proper docstring, which is important for:

- Clear function documentation and readability
- Helping language models understand the tool's purpose and when to use it
- Following Python best practices for function documentation

## Changes Made

Added a concise, one-line docstring to the `get_weather` function in `README.md`:

```python
@function_tool
def get_weather(city: str) -> str:
    """Get the current weather for a given city."""
    return f"The weather in {city} is sunny."
```
@seratch
Copy link
Member

seratch commented Aug 15, 2025

Thanks for sending this. However, in this case, the method name tells what it is, so actually there is no need to have the docstring to make it functional.

@seratch seratch closed this Aug 15, 2025
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.

2 participants