powerplatform-samples icon indicating copy to clipboard operation
powerplatform-samples copied to clipboard

Azure OpenAI Service Chat Sample initial commit

Open miguelverweij opened this issue 1 year ago • 7 comments

By submitting this pull request, you agree to the contribution guidelines

If you aren't familiar with how to contribute to open-source repositories using GitHub, or if you find the instructions on this page confusing, sign up for one of our Sharing is Caring events. It's completely free, and we'll guide you through the process.

To submit a pull request with multiple authors, make sure that at least one commit is a co-authored commit by adding a Co-authored-by: trailer to the commit's message. E.g.: Co-authored-by: name <[email protected]>

Put an x in all the items that apply ([x], without spaces), make notes next to any that haven't been addressed.

  • [ ] Bug fix?
  • [x] New sample?
  • [ ] Related issues: fixes #X, partially #Y, mentioned in #Z
  • [x] Needs API permissions?
  • [x] Has other prerequisites? (E.g. requires a list, document library, etc.)

What's in this Pull Request?

A new sample solution, Azure OpenAI Service Chat, is added to the samples folder.

Checklist

This checklist is mostly useful as a reminder of small things that can easily be forgotten – it is meant as a helpful tool rather than hoops to jump through.

Put an x in all the items that apply ([x], no spaces), make notes next to any that haven't been addressed.

  • [x] My pull request affects only ONE sample.
  • [x] I have updated the README file.
  • [x] My README has at least one static high-resolution screenshot (i.e. not a GIF)
  • [x] My README contains complete setup instructions, including pre-requisites and permissions required

miguelverweij avatar Oct 18 '23 15:10 miguelverweij

Hi @miguelverweij,

Thank you for your submission!

While attempting to import the solution, I encountered a block due to missing dependencies. Below is the log. Could you please review the source code and update it to resolve this issue?

Thank you!

[{"SolutionValidationResultType":"Error","Message":"The following solution cannot be imported: ChatGPT. Some dependencies are missing. The missing dependencies are : <MissingDependencies><MissingDependency><Required type=\"1\" schemaName=\"cr84c_promptlibrary\" displayName=\"Prompt Library\" solution=\"PromptManager (1.0.0.6)\" /><Dependent type=\"1\" schemaName=\"cr84c_promptlibrary\" displayName=\"Prompt Library\" /></MissingDependency><MissingDependency><Required type=\"1\" schemaName=\"cr84c_promptlibrary\" displayName=\"Prompt Library\" solution=\"PromptManager (1.0.0.6)\" /><Dependent type=\"10\" schemaName=\"ppchal_ppchal_chat_Prompt_cr84c_promptlibrary\" displayName=\"ppchal_ppchal_chat_Prompt_cr84c_promptlibrary\" parentSchemaName=\"cr84c_promptlibrary\" parentDisplayName=\"Prompt Library\" /></MissingDependency><MissingDependency><Required type=\"1\" schemaName=\"cr84c_promptlibrary\" displayName=\"Prompt Library\" solution=\"PromptManager (1.0.0.6)\" /><Dependent type=\"300\" schemaName=\"ppchal_chatgpt_0a0e7\" displayName=\"Azure OpenAI Service Chat\" /></MissingDependency><MissingDependency><Required type=\"1\" schemaName=\"ppchal_systemmessagetemplate\" displayName=\"System Message Template\" solution=\"Active\" /><Dependent type=\"300\" schemaName=\"ppchal_chatgpt_0a0e7\" displayName=\"Azure OpenAI Service Chat\" /></MissingDependency><MissingDependency><Required type=\"2\" schemaName=\"cr84c_name\" displayName=\"Name\" parentSchemaName=\"cr84c_promptlibrary\" parentDisplayName=\"Prompt Library\" solution=\"PromptManager (1.0.0.6)\" /><Dependent type=\"10\" schemaName=\"ppchal_ppchal_chat_Prompt_cr84c_promptlibrary\" displayName=\"ppchal_ppchal_chat_Prompt_cr84c_promptlibrary\" parentSchemaName=\"cr84c_promptlibrary\" parentDisplayName=\"Prompt Library\" /></MissingDependency><MissingDependency><Required type=\"2\" schemaName=\"cr84c_promptlibraryid\" displayName=\"Prompt Library\" parentSchemaName=\"cr84c_promptlibrary\" parentDisplayName=\"Prompt Library\" solution=\"PromptManager (1.0.0.6)\" /><Dependent type=\"10\" schemaName=\"ppchal_ppchal_chat_Prompt_cr84c_promptlibrary\" displayName=\"ppchal_ppchal_chat_Prompt_cr84c_promptlibrary\" parentSchemaName=\"cr84c_promptlibrary\" parentDisplayName=\"Prompt Library\" /></MissingDependency><MissingDependency><Required type=\"372\" schemaName=\"ppchal_azureopenaiservice\" displayName=\"AzureOpenAIService\" solution=\"Active\" id=\"{76b87ad4-2b1d-44cf-965c-df67c01b8666}\" /><Dependent type=\"29\" displayName=\"Get-Summary\" id=\"{718b1c3a-6a13-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"372\" schemaName=\"ppchal_azureopenaiservice\" displayName=\"AzureOpenAIService\" solution=\"Active\" id=\"{76b87ad4-2b1d-44cf-965c-df67c01b8666}\" /><Dependent type=\"29\" displayName=\"Get-Completion\" id=\"{7c90eb1e-2013-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"372\" schemaName=\"ppchal_azureopenaiservice\" displayName=\"AzureOpenAIService\" solution=\"Active\" id=\"{76b87ad4-2b1d-44cf-965c-df67c01b8666}\" /><Dependent type=\"300\" schemaName=\"ppchal_chatgpt_0a0e7\" displayName=\"Azure OpenAI Service Chat\" /></MissingDependency><MissingDependency><Required type=\"connectionreference\" displayName=\"admin_InnovationBacklogCDSCurrent\" solution=\"CenterofExcellenceInnovationBacklog (3.1)\" id.connectionreferencelogicalname=\"admin_InnovationBacklogCDSCurrent\" /><Dependent type=\"29\" displayName=\"Get-Completion\" id=\"{7c90eb1e-2013-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"connectionreference\" displayName=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" solution=\"Active\" id.connectionreferencelogicalname=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" /><Dependent type=\"29\" displayName=\"Get-Summary\" id=\"{718b1c3a-6a13-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"connectionreference\" displayName=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" solution=\"Active\" id.connectionreferencelogicalname=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" /><Dependent type=\"29\" displayName=\"Get-Completion\" id=\"{7c90eb1e-2013-ee11-8f6d-000d3a292ad4}\" /></MissingDependency></MissingDependencies> , ProductUpdatesOnly : False","ErrorCode":-2147188707,"AdditionalInfo":null}]

Kind regards, Katerina Chernevskaya

Katerina-Chernevskaya avatar Oct 30 '23 18:10 Katerina-Chernevskaya

Hi Katerina,

There is a solution, Prompt Library, that is a prerequisite. I have stated this in the Readme file. Initially I had a similar functionality in my own solution. Later I saw that April Dunham created a fabulous solution to store prompts. Much more advanced than what I created. I though about adding the chat functionality to her solution and make a PR, but I thought a separate solution would not interfere that install process.

So the solution would be to install that solution first. I hope this clarifies and resolves the issue.

miguelverweij avatar Oct 30 '23 20:10 miguelverweij

Hi @miguelverweij,

Thank you for the clarification! I will try again and if everything will be ok I will change the link in prerequisites before the merge, because now it redirects to your solution, not to the Prompt Library by April Dunnam. I will let you know once I complete testing. image

Regards, Kate

Katerina-Chernevskaya avatar Oct 31 '23 06:10 Katerina-Chernevskaya

Hi @miguelverweij,

The new attempt after install the Prompt Library solution, failed again due to missing dependencies. Please review the log below and update your source code to resolve this issue. Thank you!

[{"SolutionValidationResultType":"Error","Message":"The following solution cannot be imported: ChatGPT. Some dependencies are missing. The missing dependencies are : <MissingDependencies><MissingDependency><Required type=\"1\" schemaName=\"ppchal_systemmessagetemplate\" displayName=\"System Message Template\" solution=\"Active\" /><Dependent type=\"300\" schemaName=\"ppchal_chatgpt_0a0e7\" displayName=\"Azure OpenAI Service Chat\" /></MissingDependency><MissingDependency><Required type=\"372\" schemaName=\"ppchal_azureopenaiservice\" displayName=\"AzureOpenAIService\" solution=\"Active\" id=\"{76b87ad4-2b1d-44cf-965c-df67c01b8666}\" /><Dependent type=\"29\" displayName=\"Get-Summary\" id=\"{718b1c3a-6a13-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"372\" schemaName=\"ppchal_azureopenaiservice\" displayName=\"AzureOpenAIService\" solution=\"Active\" id=\"{76b87ad4-2b1d-44cf-965c-df67c01b8666}\" /><Dependent type=\"29\" displayName=\"Get-Completion\" id=\"{7c90eb1e-2013-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"372\" schemaName=\"ppchal_azureopenaiservice\" displayName=\"AzureOpenAIService\" solution=\"Active\" id=\"{76b87ad4-2b1d-44cf-965c-df67c01b8666}\" /><Dependent type=\"300\" schemaName=\"ppchal_chatgpt_0a0e7\" displayName=\"Azure OpenAI Service Chat\" /></MissingDependency><MissingDependency><Required type=\"connectionreference\" displayName=\"admin_InnovationBacklogCDSCurrent\" solution=\"CenterofExcellenceInnovationBacklog (3.1)\" id.connectionreferencelogicalname=\"admin_InnovationBacklogCDSCurrent\" /><Dependent type=\"29\" displayName=\"Get-Completion\" id=\"{7c90eb1e-2013-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"connectionreference\" displayName=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" solution=\"Active\" id.connectionreferencelogicalname=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" /><Dependent type=\"29\" displayName=\"Get-Summary\" id=\"{718b1c3a-6a13-ee11-8f6d-000d3a292ad4}\" /></MissingDependency><MissingDependency><Required type=\"connectionreference\" displayName=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" solution=\"Active\" id.connectionreferencelogicalname=\"ppchal_sharedazureopenaiservice5f534785e02bede9d05fae562e10a2de687a_7cd22\" /><Dependent type=\"29\" displayName=\"Get-Completion\" id=\"{7c90eb1e-2013-ee11-8f6d-000d3a292ad4}\" /></MissingDependency></MissingDependencies> , ProductUpdatesOnly : False","ErrorCode":-2147188707,"AdditionalInfo":null}]

Regards, Katerina Chernevskaya

Katerina-Chernevskaya avatar Oct 31 '23 07:10 Katerina-Chernevskaya

I checked what is going on, and I think I have to apologize. I haven't tested importing the solution properly. I just did and I know what to fix. I will update the files tomorrow. Sorry for the inconvenience.

miguelverweij avatar Nov 08 '23 18:11 miguelverweij

All files are ready now. I removed a data source from the Canvas App. This was causing dependencies. I also moved the Custom Connector into a separate solution. This solution should be imported first. You should first create a connection on this connector to map it to a connection reference. I have updated the README file accordingly. If you will try it in your own environment, you might want to remove the custom connector you manually created earlier.

Again sorry for the inconvenience.

miguelverweij avatar Nov 09 '23 11:11 miguelverweij

Hi @miguelverweij,

I've successfully compiled the solutions from the source code. However, I've encouraged an issue in the Azure OpenAI Service Chat app. When I try to create a new chat in the app, the option doesn't seem to be available: image

I made sure to complete all the steps listed in your guide, including the prerequisites.

Could you please provide any insights or additional guidance on how to resolve this and successfully create a new chat?

Thank you in advance!

Regards, Katerina Ch.

Katerina-Chernevskaya avatar Dec 18 '23 11:12 Katerina-Chernevskaya