Skip to content

Conversation

@hieutrtr
Copy link

@hieutrtr hieutrtr commented May 1, 2025

Purpose:
The get_tool_call_output method provides a convenient way to retrieve the output of a specific tool call by its name. This is particularly useful when:

  1. Working with multiple tool calls in an agent interaction
  2. Need to access specific tool results for post-processing or validation
  3. Want to check if a particular tool was called and what its output was

Problem It Solves:
Without this method, developers would need to:

  1. Manually iterate through the new_items list
  2. Match tool calls with their corresponding outputs using call_id
  3. Handle potential errors and edge cases themselves
    This leads to repetitive code and potential errors. The method encapsulates this common operation in a clean, reusable way.

…umentation

This commit introduces the `get_tool_call_output` method to the `RunResultBase` class, allowing retrieval of tool call outputs by name. Additionally, the documentation in `results.md` has been updated to include usage examples for this new method. Unit tests have been added to ensure functionality and handle various scenarios, including successful retrieval, non-existent tools, and mismatched call IDs.
@hieutrtr hieutrtr changed the title Implement get_tool_call_output method in RunResultBase and update doc… Implement get_tool_call_output method in RunResultBase and update doc May 1, 2025
@hieutrtr hieutrtr marked this pull request as draft May 1, 2025 13:28
@hieutrtr hieutrtr closed this May 1, 2025
@hieutrtr hieutrtr reopened this May 1, 2025
@hieutrtr hieutrtr marked this pull request as ready for review May 1, 2025 13:31
@hieutrtr hieutrtr changed the title Implement get_tool_call_output method in RunResultBase and update doc feat: Implement get_tool_call_output method in RunResultBase and update doc May 1, 2025
@github-actions
Copy link
Contributor

This PR is stale because it has been open for 10 days with no activity.

@github-actions github-actions bot added the stale label May 12, 2025
@github-actions
Copy link
Contributor

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant