diff --git a/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.md b/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.md index 8cde912..f140095 100644 --- a/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.md +++ b/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.md @@ -18,7 +18,8 @@ The second solution **Solution 2** pre-processes the file within the Azure Funct ### Solution 1: Returning the file to GPT using the [Returning Files](https://platform.openai.com/docs/actions/getting-started/returning-files) pattern -![](./images/solution_1.gif) + +![](../../../images/solution_1.gif) This solution uses a Node.js Azure Function to, based on the logged in user: @@ -30,13 +31,17 @@ This solution uses a Node.js Azure Function to, based on the logged in user: 4. Return that to ChatGPT. The GPT then can use those files as if you had uploaded it to the conversation. -![](./images/solution_1_architecture.png) + +![](../../../images/solution_1_architecture.png) + ### Solution 2: Converting the file to text in the Azure Function -![](./images/solution_2.gif) + +![](../../../images/solution_2.gif) + This solution uses a Node.js Azure Function to, based on the logged in user: @@ -51,7 +56,8 @@ This solution uses a Node.js Azure Function to, based on the logged in user: As you can see from the below architecture diagram, the first three steps are the same as Solution 1. The main difference is that this solution converts the file to text instead of a base64 string, and then summarizes that text using GPT 3.5 Turbo. -![](./images/solution_2_architecture.png) + +![](../../../images/solution_2_architecture.png) @@ -84,7 +90,7 @@ As you can see from the below architecture diagram, the first three steps are th ## Solution 1 + Solution 2 Installation Instructions The below are the instructions for setting up the Azure Function with Authentication. Please make sure to follow these steps before implementing the code. -> [!NOTE] + > These installation instructions apply to both Solution 1 and Solution 2. We encourage setting both solutions up as separate functions within the same Function App to test which works best for you, as once you set up one function, it takes only a few minutes to set up another function in that same function app. @@ -107,7 +113,9 @@ See the documentation [here](https://learn.microsoft.com/en-us/azure/azure-funct ##### Part 1: Create Function -![](./images/create_function_app.png) + +![](../../../images/create_function_app.png) + 1. Create an [Azure Function app](https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview?pivots=programming-language-csharp). I used the following settings but you can use anything you are comfortable with. Note that not every language / operating system allows for editing the functions in the console directly - the combination I chose below does. For my walkthrough, I left everything as default and made the selections below @@ -125,7 +133,6 @@ See the documentation [here](https://learn.microsoft.com/en-us/azure/azure-funct 2. After completing the above, you’ll land on the “Deployments” page. Once the deployment completes (which should only take a few minutes) click on **“Go to Resource”** to go back to the Function App - > [!NOTE] > You may get an error the first time you attempt this, click create again and it will likely work. @@ -176,7 +183,9 @@ See the documentation [here](https://learn.microsoft.com/en-us/azure/azure-funct 10. Click on the function you just created (You may need to click refresh to see it). Click on **Get Function URL** and save it to test in Postman. You will also use this when creating the OpenAPI spec later when you put it into the GPT.  -![](./images/get_function_url.png) + +![](../../../images/get_function_url.png) + 11. Go back to the function app and click on **Configuration.** Show the value for the `MICROSOFT_PROVIDER_AUTHENTICATION_SECRET` variable, copy it (click advanced edit to copy it), and **save it for later.**   @@ -209,7 +218,7 @@ At this point, you should have a test function created, and you should have save Now that you have an authenticated Azure Function, we can update the function to search SharePoint / O365 14. Go to your test function and paste in the code from [this file](./solution_one_file_retrieval.js) for Solution 1 and [this file](./solution_two_preprocessing.js) for Solution 2. Save the function.  -> [!NOTE] + > **This code is meant to be directional** - while it should work out of the box, it is designed to be customized to your needs (see examples towards the end of this document). 15. Set up the following env variables by going to the **Configuration** tab on the left under **Settings.** Note that this may be listed directly in **Environment Variables** depending on your Azure UI. diff --git a/images/create_function_app.png b/images/create_function_app.png new file mode 100644 index 0000000..a94d580 Binary files /dev/null and b/images/create_function_app.png differ diff --git a/images/get_function_url.png b/images/get_function_url.png new file mode 100644 index 0000000..b7a0320 Binary files /dev/null and b/images/get_function_url.png differ diff --git a/images/solution_1.gif b/images/solution_1.gif new file mode 100644 index 0000000..379f05e Binary files /dev/null and b/images/solution_1.gif differ diff --git a/images/solution_1_architecture.png b/images/solution_1_architecture.png new file mode 100644 index 0000000..fe4f6db Binary files /dev/null and b/images/solution_1_architecture.png differ diff --git a/images/solution_2.gif b/images/solution_2.gif new file mode 100644 index 0000000..d109780 Binary files /dev/null and b/images/solution_2.gif differ diff --git a/images/solution_2_architecture.png b/images/solution_2_architecture.png new file mode 100644 index 0000000..6890196 Binary files /dev/null and b/images/solution_2_architecture.png differ diff --git a/registry.yaml b/registry.yaml index 0a3fb57..5ad6af8 100644 --- a/registry.yaml +++ b/registry.yaml @@ -1313,5 +1313,4 @@ - maxreid-openai tags: - completions - - chatgpt - - whisper + - chatgpt \ No newline at end of file