Skip to content

docs: Add a type-safe example for custom tool_use_behavior #1358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

MuhammadHamidRaza
Copy link
Contributor

This PR improves an existing documentation example by making it more type-safe.

The change replaces the generic Any type with TContext for the RunContextWrapper in the custom_tool_handler function. This provides a more accurate and robust example for developers, demonstrating a best practice for using the library's context system.

The improved example highlights:

  • Proper use of the generic TContext type.
  • Enhanced code clarity and type safety.
  • A strong reference for other developers to follow when implementing custom tool handlers.

@seratch seratch added the documentation Improvements or additions to documentation label Aug 3, 2025
@seratch
Copy link
Member

seratch commented Aug 3, 2025

Thanks for sending this, but TContext is an abtract type representation. So, this change is not relevant for the example code.

@seratch seratch closed this Aug 3, 2025
chatgpt-connector[bot]

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants