Closed emmaforthcom closed 2 months ago
Thanks for the feedback @emmaforthcom. Found the error on https://github.com/microsoft/Generative-AI-for-beginners-dotnet/blob/main/02-SetupDevEnvironment/getting-started-azure-openai.md, we need to update the packages to use these versions:
```bash
dotnet add package Azure.AI.OpenAI --version 2.2.0-beta.2
dotnet add package Microsoft.Extensions.AI.OpenAI --version 9.3.0-preview.1.25114.11
```
I'm creating and publishing a fix right now!
Fixed with PR https://github.com/microsoft/Generative-AI-for-beginners-dotnet/pull/63
Thanks!
Following the initial setup using open-ai.
In Program.cs on BasicChat-01MEAI I have made the suggested changes to create the client.
.... IChatClient client = new AzureOpenAIClient( endpoint, apiKey) .AsChatClient(deploymentName);
var response = await client.GetResponseAsync("What is AI?");
When I run I get the following error: Unhandled exception. System.TypeLoadException: Method 'GetResponseAsync' in type 'Microsoft.Extensions.AI.OpenAIChatClient' from assembly 'Microsoft.Extensions.AI.OpenAI, Version=9.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. at Microsoft.Extensions.AI.OpenAIClientExtensions.AsChatClient(OpenAIClient openAIClient, String modelId) at Program.$(String[] args) in /workspaces/Generative-AI-for-beginners-dotnet/02-SetupDevEnvironment/src/BasicChat-01MEAI/Program.cs:line 10
at Program.(String[] args)
I'm sure it is something obvious but I can't see it for looking.