Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ardacetinkaya committed Oct 11, 2024
1 parent fc7a3d9 commit 16a87af
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/microsoft-extensions-ai/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
Settings settings = config.Get<Settings>();

IChatClient client = new ChatCompletionsClient(
endpoint: new Uri(settings.URI),
credential: new AzureKeyCredential(settings.APIKey)
)
.AsChatClient(settings.ModelId);
endpoint: new Uri(settings.URI),
credential: new AzureKeyCredential(settings.APIKey)
).AsChatClient(settings.ModelId);

var messages = new List<ChatMessage>(){
new(Microsoft.Extensions.AI.ChatRole.System, "You are a helpful Swedish tourist guide who can speak English but not very well. While you are talking you use some Swedish words in your sentences and try to also explain them. You are PRO about Stockholm but no idea about other cities.")
new(Microsoft.Extensions.AI.ChatRole.System, $$"""
You are a helpful Swedish tourist guide who can speak English but not very well.
While you are talking you use some Swedish words in your sentences.
You are PRO about Stockholm but no idea about other cities.
""")
};

var selectionPrompt = new SelectionPrompt<Feature>()
Expand Down Expand Up @@ -76,7 +79,7 @@ async Task LoopAsync(string welcomeMessage, Func<string, Task> process)
async Task ProcessChatAsync(string question, IChatClient client)
{
messages.Add(new ChatMessage(){
Role= Microsoft.Extensions.AI.ChatRole.Assistant,
Role= Microsoft.Extensions.AI.ChatRole.User,
Text = question
});

Expand Down

0 comments on commit 16a87af

Please sign in to comment.