Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 7, 2025

The Foundry Local section in 06-LocalModelRunners.md was missing the actual C# code samples, unlike the AI Toolkit and Docker sections which included complete code examples.

This PR adds comprehensive code samples for both Foundry Local integration approaches:

1. Semantic Kernel with Foundry Local

Shows the complete implementation including:

  • Kernel configuration with OpenAI chat completion
  • Chat history management
  • Streaming chat responses with interactive loop

2. Microsoft Extensions for AI with Foundry Local

Demonstrates:

  • OpenAI client setup with custom endpoint
  • Sentiment analysis example with multiple product reviews
  • Complete prompt building and response handling

The code samples are extracted from the existing working projects:

  • AIFoundryLocal-01-SK-Chat/Program.cs
  • AIFoundryLocal-01-MEAI-Chat/Program.cs

This ensures developers have ready-to-use examples that match the format and style of other sections in the documentation.

Fixes #171.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://www.microsoft.com:80/pkiops/crl/Microsoft%20Identity%20Verification%20Root%20Certificate%20Authority%202020.crl
    • Triggering command: dotnet build CoreGenerativeAITechniques.sln --verbosity minimal (http block)
  • http://www.microsoft.com:80/pkiops/crl/Microsoft%20Public%20RSA%20Timestamping%20CA%202020.crl
    • Triggering command: dotnet build CoreGenerativeAITechniques.sln --verbosity minimal (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Foundry Local does not include code samples Add missing C# code samples for Foundry Local integration in documentation Jun 7, 2025
Copilot AI requested a review from elbruno June 7, 2025 19:18
Copilot finished work on behalf of elbruno June 7, 2025 19:18
Copy link
Collaborator

@elbruno elbruno left a comment

Choose a reason for hiding this comment

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

Looks good!

@github-actions
Copy link

github-actions bot commented Jun 7, 2025

Check Broken Paths

We have automatically detected the following broken relative paths in your files.
Review and fix the paths to resolve this issue.

Check the file paths and associated broken paths inside them.
For more details, check our Contributing Guide.

File Full Path Issues
translations/de/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/de/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/de/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md49
translations/de/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/pt/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/pt/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/pt/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/pt/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/zh/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/zh/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/zh/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/zh/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/tw/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/tw/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/tw/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/tw/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/fr/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/fr/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/fr/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/fr/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/es/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/es/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/es/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/es/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/ja/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/ja/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/ja/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/ja/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/ko/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/ko/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/ko/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/ko/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16

1 similar comment
@github-actions
Copy link

github-actions bot commented Jun 7, 2025

Check Broken Paths

We have automatically detected the following broken relative paths in your files.
Review and fix the paths to resolve this issue.

Check the file paths and associated broken paths inside them.
For more details, check our Contributing Guide.

File Full Path Issues
translations/de/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/de/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/de/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md49
translations/de/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/pt/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/pt/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/pt/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/pt/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/zh/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/zh/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/zh/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/zh/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/tw/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/tw/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/tw/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/tw/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/fr/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/fr/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/fr/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/fr/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/es/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/es/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/es/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/es/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/ja/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/ja/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/ja/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/ja/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16
translations/ko/README.md
#LinkLine Number
1../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs42
2../03-CoreGenerativeAITechniques/src/ImageGeneration-01/ImageGeneration-01.csproj46
translations/ko/03-CoreGenerativeAITechniques/readme.md
#LinkLine Number
1./06-LocalModelRunners.md25
translations/ko/03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1./06-LocalModelRunners.md43
translations/ko/10-WhatsNew/readme.md
#LinkLine Number
1../../03-CoreGenerativeAITechniques/src/VideoGeneration-AzureSora-01/Program.cs16

@elbruno elbruno marked this pull request as ready for review June 7, 2025 19:29
@elbruno elbruno merged commit 7f5270a into main Jun 7, 2025
5 of 9 checks passed
@elbruno elbruno deleted the copilot/fix-171 branch June 7, 2025 19:30
@github-actions
Copy link

github-actions bot commented Jun 7, 2025

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them.
For more details, check our Contributing Guide.

File Full Path Issues
02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/161
translations/de/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/de/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg13
translations/pt/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/pt/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/zh/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/zh/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/tw/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/tw/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/fr/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/fr/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/es/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/es/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/ja/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/160
translations/ja/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/ko/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/ko/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/openai/concepts/understanding-image-generation-responses152

1 similar comment
@github-actions
Copy link

github-actions bot commented Jun 7, 2025

Check Broken URLs

We have automatically detected the following broken URLs in your files. Review and fix the paths to resolve this issue.

Check the file paths and associated broken URLs inside them.
For more details, check our Contributing Guide.

File Full Path Issues
02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/161
translations/de/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/de/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg13
translations/pt/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/pt/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/zh/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/zh/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/tw/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/tw/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/fr/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/fr/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/es/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/es/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/ja/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/160
translations/ja/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
translations/ko/02-SetupDevEnvironment/getting-started-azure-openai.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/deploy/159
translations/ko/03-CoreGenerativeAITechniques/06-AIToolkitAndDockerModels.md
#LinkLine Number
1https://img.youtube.com/vi/1GwmV1PGRjI/0.jpg9
03-CoreGenerativeAITechniques/05-ImageGenerationOpenAI.md
#LinkLine Number
1https://learn.microsoft.com/azure/ai-services/openai/concepts/understanding-image-generation-responses152

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Foundry Local does not include code samples

2 participants