Skip to content

Conversation

@rogerbarreto
Copy link
Member

Motivation and Context

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings December 12, 2025 10:38
@rogerbarreto rogerbarreto changed the title .NET: Simplify sample TokenCredential impl, removing unnecessary complexity. .NET: Simplify Anthropic Foundry sample TokenCredential impl, removing unnecessary complexity. Dec 12, 2025
Copy link
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 simplifies the AnthropicAzureTokenCredential implementation in the Anthropic sample by removing token caching logic and converting to a primary constructor pattern. While this reduces code complexity, it introduces performance concerns.

Key changes:

  • Converted from traditional constructor to C# primary constructor syntax
  • Removed token caching, lock mechanism, and token expiration handling
  • Simplified the Apply method to directly fetch tokens on each invocation

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.

3 participants