MicrosoftLearning / mslearn-openai

https://microsoftlearning.github.io/mslearn-openai/
MIT License
214 stars 325 forks source link

Facing an issue with Lab Exercises instructions- 02-natural-language-azure-openai.md #32

Closed NethraKonkamurthy closed 7 months ago

NethraKonkamurthy commented 7 months ago

Hi, I am trying to follow the instructions in the repo https://github.com/MicrosoftLearning/mslearn-openai/blob/main/Instructions/Exercises/02-natural-language-azure-openai.md and in the section: Add code to use the Azure OpenAI service -> Step 2 -> while adding a new chat message I am facing an error. Is it because the class chatmessage doesn't exist in the Azure.AI.OpenAI namespace and documentation has to be corrected as below. Could you please help on this?

Messages = { // new ChatMessage(ChatRole.System, "You are a helpful assistant."), --> old code new ChatRequestSystemMessage("\"You are a helpful assistant.\""), // new ChatMessage(ChatRole.User, "Summarize the following text in 20 words or less:\n" + text), -->old code new ChatRequestUserMessage("Summarize the following text in 20 words or less:\n" + text), }, AzureOpenAI Error: The type or namespace name 'ChatMessage' could not be found

Thanks, Nethra

ivorb commented 7 months ago

hi @NethraKonkamurthy, if you look at the package installation, the instructions say to use beta.9 - if you install that version of the SDK, the code as written will work. The docs pages you're looking at are for beta.13 where some of the objects have changed. There will be updates coming to bring these samples up to beta.13 soon, but for now please use beta.9