Skip to content

Commit

Permalink
Update E3T1 and E2T2
Browse files Browse the repository at this point in the history
  • Loading branch information
feaselkl committed Sep 13, 2024
1 parent 253cbf0 commit 453c91a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/02_implement_function_calls/0202.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ The key tasks are as follows:
5. The `AppConfig.cs` file contains a simple configuration class. Update the `Program.cs` file to use this configuration class to build out a configuration. Add in any user secrets associated with the (implicit) `Program` class as well as environment variables, and then validate the configuration.
6. In `Program.cs`, add a singleton of type `Microsoft.SemanticKernel.Kernel`. It should create an `IKernelBuilder` and then add Azure OpenAI chat completion, using the deployment name, endpoint, and API key from your configuration. It should also add as a plugin everything in the `DatabaseService` class.
7. Implement the `/Chat` POST request. It should use the `Kernel` singleton and get chat message content from the chat completion service. Return to the end user `response?.Content!`.
8. Run the Web API project and ensure that things work correctly. You can perform a simple test in PowerShell using the following request.
8. Run the Web API project and ensure that things work correctly. If you are using GitHub Codespaces, run the following command:

```bash
curl -d 'message="Which bookings do not currently have hotel rooms associated with them?"' http://localhost:5292/Chat
```

You can alternatively perform a simple test in PowerShell using the following request.

```powershell
$postParams = @{ message="Which bookings do not currently have hotel rooms associated with them?" }
Expand Down Expand Up @@ -84,6 +90,13 @@ The key tasks are as follows:
dotnet user-secrets set "AzureOpenAI:ApiKey" "{your_key}"
```

- The new code for the `IDatabaseService` interface is as follows:

```csharp
Task<IEnumerable<Booking>> GetBookingsMissingHotelRooms();
Task<IEnumerable<Booking>> GetBookingsWithMultipleHotelRooms();
```

- The code for the `GetBookingsMissingHotelRooms()` method is in the `DatabaseService` class as follows:

```csharp
Expand Down
3 changes: 3 additions & 0 deletions docs/03_implement_vector_search_in_cosmos_db_nosql/0301.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ The key tasks are as follows:
- Index type: Select **diskANN**. Given the number of dimensions being specified, 1536, the `flat` index type will not work, as it only supports a maximum of 505 dimensions for vectors. The `quantizedFlat` index could also be used here. `diskANN` is a more efficient index type, but given the amount of data we are working with in this lab, you likely will not notice any difference in performance.
- Select **OK** to create the container.
{: .note }
> If you receive an error message that "A Container Vector Policy has been provided, but the capability has not been enabled on your account," wait another 5-10 minutes before trying again.
</details>

0 comments on commit 453c91a

Please sign in to comment.