Skip to content

Commit

Permalink
Merge branch 'main' into users/markwallace/issue_6724_1
Browse files Browse the repository at this point in the history
  • Loading branch information
markwallace-microsoft authored Oct 15, 2024
2 parents cbe97a0 + 6b1079c commit 70f68c7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dotnet/samples/Demos/StepwisePlannerMigration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ IChatCompletionService chatCompletionService = kernel.GetRequiredService<IChatCo
ChatHistory chatHistory = [];
chatHistory.AddUserMessage("Check current UTC time and return current weather in Boston city.");

OpenAIPromptExecutionSettings executionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions };
OpenAIPromptExecutionSettings executionSettings = new() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() };

await chatCompletionService.GetChatMessageContentAsync(chatHistory, executionSettings, kernel);

Expand Down Expand Up @@ -87,7 +87,7 @@ Kernel kernel = Kernel
.AddOpenAIChatCompletion("gpt-4", Environment.GetEnvironmentVariable("OpenAI__ApiKey"))
.Build();

OpenAIPromptExecutionSettings executionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions };
OpenAIPromptExecutionSettings executionSettings = new() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() };

FunctionResult result = await kernel.InvokePromptAsync("Check current UTC time and return current weather in Boston city.", new(executionSettings));

Expand Down Expand Up @@ -124,7 +124,7 @@ IChatCompletionService chatCompletionService = kernel.GetRequiredService<IChatCo

ChatHistory existingPlan = GetExistingPlan(); // plan can be stored in database for reusability.
OpenAIPromptExecutionSettings executionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions };
OpenAIPromptExecutionSettings executionSettings = new() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() };

ChatMessageContent result = await chatCompletionService.GetChatMessageContentAsync(chatHistory, executionSettings, kernel);

Expand Down
2 changes: 1 addition & 1 deletion dotnet/samples/GettingStarted/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The examples can be run as integration tests but their code can also be copied t

Most of the examples will require secrets and credentials, to access OpenAI, Azure OpenAI,
Bing and other resources. We suggest using .NET
[Secret Manager](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets)
[Secret Manager](https://learn.microsoft.com/aspnet/core/security/app-secrets)
to avoid the risk of leaking secrets into the repository, branches and pull requests.
You can also use environment variables if you prefer.

Expand Down
14 changes: 13 additions & 1 deletion dotnet/samples/GettingStartedWithTextSearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ The examples can be run as integration tests but their code can also be copied t

Most of the examples will require secrets and credentials, to access OpenAI, Azure OpenAI,
Bing and other resources. We suggest using .NET
[Secret Manager](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets)
[Secret Manager](https://learn.microsoft.com/aspnet/core/security/app-secrets)
to avoid the risk of leaking secrets into the repository, branches and pull requests.
You can also use environment variables if you prefer.

**NOTE**
The `Step2_Search_For_RAG.RagWithBingTextSearchUsingFullPagesAsync` sample requires a large context window so we recommend using `gpt-4o` or `gpt-4o-mini` models.

To set your secrets with Secret Manager:

```
Expand All @@ -23,6 +26,10 @@ dotnet user-secrets set "OpenAI:EmbeddingModelId" "..."
dotnet user-secrets set "OpenAI:ChatModelId" "..."
dotnet user-secrets set "OpenAI:ApiKey" "..."
dotnet user-secrets set "Bing:ApiKey" "..."
dotnet user-secrets set "Google:SearchEngineId" "..."
dotnet user-secrets set "Google:ApiKey" "..."
```

To set your secrets with environment variables, use these names:
Expand All @@ -31,4 +38,9 @@ To set your secrets with environment variables, use these names:
OpenAI__EmbeddingModelId
OpenAI__ChatModelId
OpenAI__ApiKey
Bing__ApiKey
Google__SearchEngineId
Google__ApiKey
```
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public async Task RagWithBingTextSearchUsingFullPagesAsync()
// Create a kernel with OpenAI chat completion
IKernelBuilder kernelBuilder = Kernel.CreateBuilder();
kernelBuilder.AddOpenAIChatCompletion(
modelId: TestConfiguration.OpenAI.ChatModelId,
modelId: TestConfiguration.OpenAI.ChatModelId, // Requires a large context window e.g. gpt-4o or gpt-4o-mini
apiKey: TestConfiguration.OpenAI.ApiKey);
Kernel kernel = kernelBuilder.Build();

Expand Down

0 comments on commit 70f68c7

Please sign in to comment.