This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start a chat loop | |
Console.WriteLine("Chat with the Semantic Kernel! Type 'exit' to quit."); | |
var history = new ChatHistory(); | |
while (true) | |
{ | |
Console.Write("You: "); | |
var userInput = Console.ReadLine(); | |
if (string.Equals(userInput, "exit", StringComparison.OrdinalIgnoreCase)) break; | |
history.AddUserMessage(userInput); | |
var response = await chat.GetChatMessageContentAsync(history); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.SemanticKernel; | |
using Microsoft.SemanticKernel.ChatCompletion; | |
// Create a kernel and chat completion service | |
var builder = Kernel.CreateBuilder(); | |
builder.AddOpenAIChatCompletion("Phi-3.5-mini-instruct-cuda-gpu", new Uri("http://localhost:5273/v1"),null); | |
var kernel = builder.Build(); | |
var chat = kernel.GetRequiredService<IChatCompletionService>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
private static readonly string[] Summaries = new[] | |
{ | |
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |
}; | |
private readonly ILogger<WeatherForecastController> _logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ABTestTrackingService | |
{ | |
private readonly ILogger<ABTestTrackingService> _logger; | |
private readonly IFeatureManager _featureManager; | |
public ABTestTrackingService(ILogger<ABTestTrackingService> logger, IFeatureManager featureManager) | |
{ | |
_logger = logger; | |
_featureManager = featureManager; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
private static readonly string[] Summaries = new[] | |
{ | |
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |
}; | |
private readonly ILogger<WeatherForecastController> _logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApiController] | |
[Route("[controller]")] | |
public class WeatherForecastController : ControllerBase | |
{ | |
private static readonly string[] Summaries = new[] | |
{ | |
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |
}; | |
private readonly ILogger<WeatherForecastController> _logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Logging": { | |
"LogLevel": { | |
"Default": "Information", | |
"Microsoft.AspNetCore": "Warning" | |
} | |
}, | |
"AllowedHosts": "*", | |
"feature_management": { | |
"feature_flags": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.FeatureManagement; | |
using Microsoft.FeatureManagement.FeatureFilters; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.AddServiceDefaults(); | |
// Add services to the container. | |
builder.Services.AddFeatureManagement() | |
.AddFeatureFilter<PercentageFilter>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void No_Breaking_Changes_Found_Between_API_Versions() | |
{ | |
//Read the openapi document from the openapi endpoint | |
var oldSpec = File.ReadAllText("https://example/openapi/v1.json"); | |
var newSpec = File.ReadAllText("projectname.json"); | |
IEnumerable<ParsingError> parsingErrors; | |
var differences = OpenApiComparator.Compare(oldSpec,newSpec, out parsingErrors); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "NullabilityAPI | v1", | |
"version": "1.0.0" | |
}, | |
"servers": [ | |
{ | |
"url": "https://localhost:7168/" | |
} |
NewerOlder