Skip to content

Conversation

mutahirshah11
Copy link
Contributor

Summary

This PR updates the FunctionTool example by replacing the placeholder do_some_work() function with a more practical version, process_user_data(). The new function showcases how structured input (username, age) is validated and returned, making the example clearer and more useful for developers.

Changes Made

  • Replaced the dummy function do_some_work() with process_user_data()
  • Updated input schema class to use realistic field names (username, age)
  • Preserved the structure and logic of the original FunctionTool example

Why This Matters

The current example in the SDK returns a static string and doesn't utilize the input fields, which can be confusing for new developers. This updated version provides a more realistic demonstration of tool invocation and structured input processing — while keeping the example minimal and educational.

@seratch
Copy link
Member

seratch commented Jul 11, 2025

Thanks for the suggestions, but as I mentioned at #1054, the change is not necessary. Also, the code snippet changes in the documentation could be fine but we may do something like that in a more consistent way in the future. Thanks again for sending this.

@seratch seratch closed this Jul 11, 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