Forum Discussion
SetSearchKey and SetEmbeddingKey return "does not contain a definition for ..."
I'm currently using Azure.AI.OpenAI 1.0 beta 12, I'm using the samples provided by Microsoft however when I compile the code I get the following error
'AzureCognitiveSearchChatExtensionConfiguration' does not contain a definition for 'SetSearchKey' and no accessible extension method 'SetSearchKey' accepting a first argument of type 'AzureCognitiveSearchChatExtensionConfiguration' could be found (are you missing a using directive or an assembly reference?)
and
'AzureCognitiveSearchChatExtensionConfiguration' does not contain a definition for 'SetEmbeddingKey' and no accessible extension method 'SetEmbeddingKey' accepting a first argument of type 'AzureCognitiveSearchChatExtensionConfiguration' could be found (are you missing a using directive or an assembly reference?).
The lines of code I'm using are
I've checked the solution and it has the correct version of Azure.AI.OpenAI installed.
Any thoughts welcome.
Thanks
Rob Ireland
1 Reply
- Atul-kCopper Contributor
Use version beta 9 instead of 12 and it will work. In the new version 12, they somehow removed this method. I ran through same problem and fixed when used 9.
Use below:
"dotnet add package Azure.AI.OpenAI --version 1.0.0-beta.9"