Skip to content

Fix function definition equality and expose ServerLabel.#53085

Merged
nick863 merged 5 commits intomainfrom
nirovins/function_definition_eq
Oct 10, 2025
Merged

Fix function definition equality and expose ServerLabel.#53085
nick863 merged 5 commits intomainfrom
nirovins/function_definition_eq

Conversation

@nick863
Copy link
Copy Markdown
Member

@nick863 nick863 commented Oct 8, 2025

Contributing to the Azure SDK

See: #53043 and #53001

Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.

For specific information about pull request etiquette and best practices, see this section.

Copilot AI review requested due to automatic review settings October 8, 2025 22:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the implementation of equality comparison for FunctionToolDefinition by ensuring the GetHashCode method is consistent with the Equals method.

  • Updates GetHashCode() to use Name.GetHashCode() instead of InternalFunction.GetHashCode()
  • Adds comprehensive unit tests to verify equality behavior across different name and description combinations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Custom/FunctionToolDefinition.cs Fixed GetHashCode implementation to be consistent with Equals method
tests/UnitTests.cs Added unit test to verify function definition equality behavior

@nick863 nick863 force-pushed the nirovins/function_definition_eq branch from 765badf to 52b9080 Compare October 8, 2025 22:37
@nick863 nick863 changed the title Fix function definition equaluty. Fix function definition equality and expose . Oct 8, 2025
@nick863 nick863 changed the title Fix function definition equality and expose . Fix function definition equality and expose ServerLabel. Oct 8, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 9, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.AI.Agents.Persistent

@nick863 nick863 merged commit 96eb6ea into main Oct 10, 2025
17 checks passed
@nick863 nick863 deleted the nirovins/function_definition_eq branch October 10, 2025 18:06
@stephentoub
Copy link
Copy Markdown
Contributor

@jozkee, fyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants