Skip to content

Commit

Permalink
.Net: Update README with feedback from Bug Bash (#9249)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
markwallace-microsoft authored Oct 14, 2024
1 parent e6c20cd commit 6b1079c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ public VectorStoreTextSearch(
VectorStoreTextSearchOptions? options = null)
{
Verify.NotNull(vectorizableTextSearch);
Verify.NotNull(stringMapper);
Verify.NotNull(resultMapper);

this._vectorizableTextSearch = vectorizableTextSearch;
this._propertyReader = new Lazy<TextSearchResultPropertyReader>(() => new TextSearchResultPropertyReader(typeof(TRecord)));
Expand Down

0 comments on commit 6b1079c

Please sign in to comment.