Skip to content

docs: Enhance fetch_user_age tool: include UID and correct output format #702

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Wania-Kazmi
Copy link

Background
The existing fetch_user_age tool only displayed the user’s name and hard-coded age, and the printed comment was misleading. It also neglected the user’s unique identifier.

Issue

  • Output string in context.md was inaccurate for given string in function fetch_user_age:

    f"User {wrapper.context.name} is 47 years old"
    # The user John is 47 years old.
  • The uid field of UserInfo was never used, reducing context completeness.

Changes

  1. Use uid in the tool’s response
    Updated fetch_user_age to reference both name and uid from wrapper.context.

    - return f"User {wrapper.context.name} is 47 years old"
    + return f"User {wrapper.context.name} (ID: {wrapper.context.uid}) is 47 years old"
  2. Correct expected output in example
    Adjusted the printed comment in context.md to match the new response format.

    - # The user John is 47 years old.
    + # User John (ID: 123) is 47 years old

These updates ensure the tool provides a more complete and accurate user context, improving both clarity and correctness.

…rrect Output guardrail first step.

Enhanced the documentation for input and output guardrails by specifying that input guardrails apply only to the first agent in a sequence, while output guardrails apply only to the last agent. This clarification improves understanding of how guardrails function in agent chains.
Updated the documentation in context.md to enhance clarity by modifying the example of passing context to the run methods. The change specifies the syntax more clearly, improving understanding for users.
…string

Updated the context.md documentation to provide clearer user information by including the user ID in the output string. This change improves the clarity of the example, making it easier for users to understand the context being passed.
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