Skip to content

Conversation

@westey-m
Copy link
Contributor

Motivation and Context

#1163

Description

  • Inline const literals in samples where they are only used once, to simplify the samples.

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 October 10, 2025 15:34
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 inlines constant string literals in sample code where they are only used once, improving code simplicity and readability by removing unnecessary constant declarations.

  • Removes const string declarations for agent names and instructions
  • Inlines these values directly at their single usage points
  • Uses named parameters to improve clarity when passing inline values

Reviewed Changes

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

Show a summary per file
File Description
FoundryAgent_Hosted_MCP/Program.cs Inlined AgentName and AgentInstructions constants in agent creation
Agent_Step16_ChatReduction/Program.cs Inlined JokerName and JokerInstructions constants in agent options
Agent_Step15_Plugins/Program.cs Inlined AgentName and AgentInstructions constants in agent creation
Agent_Step10_AsMcpTool/Program.cs Inlined JokerName, JokerDescription, and JokerInstructions constants
Agent_Step09_DependencyInjection/Program.cs Inlined constants and added named parameters for clarity
Agent_Step08_Observability/Program.cs Inlined constants and added named parameters in agent creation
Agent_Step07_3rdPartyThreadStorage/Program.cs Inlined constants in agent options configuration
Agent_Step06_PersistedConversations/Program.cs Inlined constants and added named parameters in agent creation
Agent_Step02_MultiturnConversation/Program.cs Inlined constants and added named parameters in agent creation
Agent_Step01_Running/Program.cs Inlined constants and added named parameters in agent creation
Agent_OpenAI_Step01_Running/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_OpenAIResponses/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_OpenAIChatCompletion/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_Ollama/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_ONNX/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_AzureOpenAIResponses/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_AzureOpenAIChatCompletion/Program.cs Inlined constants and added named parameters in agent creation
Agent_With_AzureFoundryModel/Program.cs Inlined constants and added named parameters in agent creation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot changed the title Inline const values in samples where used only once .NET: Inline const values in samples where used only once Oct 10, 2025
@westey-m westey-m added this pull request to the merge queue Oct 10, 2025
Merged via the queue into microsoft:main with commit d6fdb91 Oct 10, 2025
14 checks passed
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