Skip to content
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

.Net: Sample Code Showcasing Usage of Reasoning Models in OpenAI and AzureOpenAI #10558

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

Conversation

joslat
Copy link
Contributor

@joslat joslat commented Feb 16, 2025

Motivation and Context

  1. Required: showing usage of reasoning effort.
  2. Problem: Controlling reasoning effort - no sample
  3. Scenario: Using reasoning effort to benefit from the new amazing models :)

Description

This pull request adds sample code that demonstrates how to leverage reasoning models in a ChatCompletion on AzureOpenAI and OpenAI.

This implementation how to leverage LLM Reasoning capabilities but also complements the phenomenal code from Roger Barreto (@RogerBarreto), further strengthening Semantic Kernel overall solution.

Contribution Checklist

@joslat joslat requested a review from a team as a code owner February 16, 2025 19:48
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code documentation labels Feb 16, 2025
@github-actions github-actions bot changed the title Sample Demo Code Showcasing Usage of Reasoning Models .Net: Sample Demo Code Showcasing Usage of Reasoning Models Feb 16, 2025
@joslat
Copy link
Contributor Author

joslat commented Feb 16, 2025

@RogerBarreto I saw there was no sample, so "giving back" a bit ;)
Also, what do you think of the example use cases? Would you change/adjust them to properly use the "reasoning effort"?

@RogerBarreto
Copy link
Member

Thanks for the sample and contribution @joslat.
I'm tagging @crickman as one of our Agent expert to have a look in the demo and comment. As we are approaching GA on the agents would be interesting to have your optinion and changes that bring a good Agent with latest reasoning capabilities to our Demo collections.

@joslat
Copy link
Contributor Author

joslat commented Feb 19, 2025

@RogerBarreto & @crickman any feedback? :)
If not, I think it fits the quality gate so we could approve, after all it's an example on "how to use the new reasoning effort parameter", that's all ;)

@crickman crickman added samples ai connector Anything related to AI connectors labels Feb 19, 2025
@crickman
Copy link
Contributor

Thanks for the sample and contribution @joslat. I'm tagging @crickman as one of our Agent expert to have a look in the demo and comment. As we are approaching GA on the agents would be interesting to have your optinion and changes that bring a good Agent with latest reasoning capabilities to our Demo collections.

@RogerBarreto - The core of the demo isn't really agent specific. I've recommended to @joslat that it be refactored as a focused sample.

@joslat joslat requested a review from crickman February 20, 2025 18:48
@joslat
Copy link
Contributor Author

joslat commented Feb 20, 2025

@crickman I think this is it, simplest implementation possible as a concept sample, ChatCompletion only.
Unsure about the configuration stuff, there I need guidance-support though. The rest is done.

@joslat
Copy link
Contributor Author

joslat commented Feb 24, 2025

Some TODO after an alignment/sync with @RogerBarreto:

  • I will update the branch and rebuild as some code has changed and is specific to Azure/OpenAI. (like OpenAIPromptExecutionSettings)
  • I will add a max tokens to circumvent an issue with this.
  • I will create two examples, one for OpenAI, other for AzureOpenAI.
  • I will leave the examples as simple and clear as possible.

Do I miss anything @RogerBarreto?

@RogerBarreto
Copy link
Member

@joslat

Update the PR Description and Title to the simplified latest changes. Thanks!

@joslat joslat changed the title .Net: Sample Demo Code Showcasing Usage of Reasoning Models .Net: Sample Code Showcasing Usage of Reasoning Models in OpenAI and AzureOpenAI Feb 24, 2025
Copy link
Member

Sounds good! Thanks!

Copy link
Member

ONe of the files in the PR changes the solution file, it's not needed.

@joslat
Copy link
Contributor Author

joslat commented Feb 24, 2025

ONe of the files in the PR changes the solution file, it's not needed.

also done :)

@joslat joslat requested a review from RogerBarreto February 24, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai connector Anything related to AI connectors documentation .NET Issue or Pull requests regarding .NET code samples
Projects
Status: Sprint: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants