# embeddings_queue

created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 7b679a2b-bd2a-4768-aa8f-3fa03de94185
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.ipynb", "title": "Using Azure Functions with OAuth and Microsoft Graph API to Search O365 / SharePoint from ChatGPT", "tokens": 10420, "retrieve_doc": false, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"7b679a2b-bd2a-4768-aa8f-3fa03de94185\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.ipynb\", \"title\": \"Using Azure Functions with OAuth and Microsoft Graph API to Search O365 / SharePoint from ChatGPT\", \"tokens\": 10420, \"retrieve_doc\": false, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"0aae3c52-be5a-4766-96d1-970b0e57f712\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.ipynb\", \"title\": \"Using Azure Functions with OAuth and Microsoft Graph API to Search O365 / SharePoint from ChatGPT\", \"tokens\": 10420, \"retrieve_doc\": false, \"source\": \"openai_cookbooks\"}, \"hash\": \"d431d2d02d5e396a3583077d51586bcf0ed0124b6aab36016c9a3724b8cce8a0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a1c74dad-e650-40f6-ad17-25ed84d97cdf\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/Using_Azure_Functions_and_Microsoft_Graph_to_Query_SharePoint.ipynb\", \"title\": \"Using Azure Functions with OAuth and Microsoft Graph API to Search O365 / SharePoint from ChatGPT\", \"tokens\": 10420, \"retrieve_doc\": false, \"source\": \"openai_cookbooks\"}, \"hash\": \"c46b8971850392be01b0537e770ddcbacc372cfcc0b1349216e8a4fe2ff2bc4f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 45160, \"end_char_idx\": 47618, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "0aae3c52-be5a-4766-96d1-970b0e57f712", "doc_id": "0aae3c52-be5a-4766-96d1-970b0e57f712", "ref_doc_id": "0aae3c52-be5a-4766-96d1-970b0e57f712", "chroma:document": "## FAQ\n\n- Why are you using the Microsoft Graph API in your code instead of the [SharePoint API](https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service?tabs=csom)?\n\n  - The SharePoint API is legacy - per the Microsoft documentation [here](https://learn.microsoft.com/en-us/sharepoint/dev/apis/sharepoint-rest-graph), \u201cFor SharePoint Online, innovation using a REST API against SharePoint is driven via the Microsoft Graph REST API's.\u201d The Graph API gives us more flexibility, and the SharePoint API still runs into the same file issues listed in the [Why is this necessary instead of interacting with the Microsoft Graph API directly?](#why-is-this-necessary-instead-of-interacting-with-the-microsoft-api-directly) section.\n\n- What types of files does this support?\n\n  - _Solution 1:_\u00a0\n\n    1. It follows the same guidelines as the documentation [here](https://help.openai.com/en/articles/8555545-file-uploads-faq) about file uploads.\u00a0\n\n  - _Solution 2:_\u00a0\n\n    1. This supports all files listed in the documentation for the Convert File endpoint [_here_](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http). Specifically, it supports _pdf, doc, docx, odp, ods, odt, pot, potm, potx, pps, ppsx, ppsxm, ppt, pptm, pptx, rtf_.\n\n    2. When a search result returns XLS, XLSX, or CSV, this prompts the user to download the file and re-upload to ask questions using Advanced Data Analysis. As stated above, we recommend solution 1 if structured data is part of your use case.\n\n- Why do I need to request an OBO token?\n\n  - When you try to use the same token to authenticate to the Graph API as the one you use to authenticate into the Azure Function, you get an \u201cinvalid audience\u201d token. This is because the audience for the token can only be user\\_impersonation.\n\n  - To address this, the function requests a new token scoped to Files.Read.All within the app using the [On Behalf Of flow](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-on-behalf-of-flow). This will inherit the permissions of the logged in user, meaning this function will only search through files the logged-in user has access to.\u00a0\n\n  - We are purposefully requesting a new On Behalf Of token with each request, because Azure Function Apps are meant to be stateless. You could potentially integrate this with Azure Key Vault to store the secret and retrieve programmatically."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 604e3c19-d9f6-426f-918f-d875ff43537d
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"604e3c19-d9f6-426f-918f-d875ff43537d\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"7aac0829-b270-4ec1-b3cc-01540c21e769\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"0af3ef85d43c953425c5f88c0d904093ac9e66e7d87b09e19958a36d9f38552f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3604, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "# GPT Action Library: Outlook\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Buliding a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to Outlook, Microsoft's web service for emailing and calendar events. This action assumes a user\u2019s context and allows them to send and retrieve emails and calendar events from Outlook.\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to Outlook\n\n**Example Use Cases**: \n- A user can look up all of their meetings for the day and have ChatGPT summarize the day\n- A user can email a ChatGPT output to someone directly\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://portal.azure.com/\n- Application API Documentation: https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Ensure you have the access and permissions to [Set up an App Registration in Azure](https://portal.azure.com/?feature.tokencaching=true&feature.internalgraphapiversion=true#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\n**Context**: you are specialized GPT designed to manage emails and calendar events through API connections to Microsoft Outlook. This GPT can create, read, send, and alter emails and calendar events based on user instructions. It ensures efficient handling of communication and scheduling needs by leveraging Microsoft Graph API for seamless integration with Outlook services.\n\n**Instructions**:\n- When asked to perform a task, use the available actions via the microsoft.graph.com API.\n- You should behave professionally and provide clear, concise responses.\n- Offer assistance with tasks such as drafting emails, scheduling meetings, organising calendar events, and retrieving email or event details.\n- Ask for clarification when needed to ensure accuracy and completeness in fulfilling user requests.\n- Always conclude an email by signing off with logged in user's name which can be retrieved via the User.Read endpoint\n\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Microsoft Graph API Integration\n  version: 1.0.0\nservers:\n  - url: https://graph.microsoft.com/v1.0\ncomponents:\n  securitySchemes:\n    OAuth2:\n      type: oauth2\n      flows:\n        clientCredentials:\n          tokenUrl: https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token\n          scopes:\n            https://graph.microsoft.com/User."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 7aac0829-b270-4ec1-b3cc-01540c21e769
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"7aac0829-b270-4ec1-b3cc-01540c21e769\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"604e3c19-d9f6-426f-918f-d875ff43537d\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"908f00127a44d1ce8c2c257b1511ca29bee5d47da6ad028898a68d6f8ae44b84\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"4754ce8f-2186-4fd2-9c3c-59aa047a628c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"a88754e261410dfdeebf1e0d3c5bab16ee62cf4ebd2809a431b927b6145fdb5d\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2024, \"end_char_idx\": 4534, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "```python\n**Context**: you are specialized GPT designed to manage emails and calendar events through API connections to Microsoft Outlook. This GPT can create, read, send, and alter emails and calendar events based on user instructions. It ensures efficient handling of communication and scheduling needs by leveraging Microsoft Graph API for seamless integration with Outlook services.\n\n**Instructions**:\n- When asked to perform a task, use the available actions via the microsoft.graph.com API.\n- You should behave professionally and provide clear, concise responses.\n- Offer assistance with tasks such as drafting emails, scheduling meetings, organising calendar events, and retrieving email or event details.\n- Ask for clarification when needed to ensure accuracy and completeness in fulfilling user requests.\n- Always conclude an email by signing off with logged in user's name which can be retrieved via the User.Read endpoint\n\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Microsoft Graph API Integration\n  version: 1.0.0\nservers:\n  - url: https://graph.microsoft.com/v1.0\ncomponents:\n  securitySchemes:\n    OAuth2:\n      type: oauth2\n      flows:\n        clientCredentials:\n          tokenUrl: https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token\n          scopes:\n            https://graph.microsoft.com/User.Read: Access current user profile\n            https://graph.microsoft.com/Mail.Read: Read user mail\n            https://graph.microsoft.com/Mail.Send: Send mail\n            https://graph.microsoft.com/Calendars.ReadWrite: Read and write user calendars\n  schemas:\n    UserProfile:\n      type: object\n      properties:\n        id:\n          type: string\n        displayName:\n          type: string\n        mail:\n          type: string\n    UserMessage:\n      type: object\n      properties:\n        id:\n          type: string\n        subject:\n          type: string\n        bodyPreview:\n          type: string\n    CalendarEvent:\n      type: object\n      properties:\n        id:\n          type: string\n        subject:\n          type: string\n        start:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n        end:\n          type: object"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 4754ce8f-2186-4fd2-9c3c-59aa047a628c
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"4754ce8f-2186-4fd2-9c3c-59aa047a628c\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"7aac0829-b270-4ec1-b3cc-01540c21e769\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1325fc72f7219959a7a02e53caae7d2fb15d2db3df734008491120615fb07df0\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b36ed2b5-80f5-471d-b1cd-a3f4fc39c26a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"11076a725ee66c26f8fb1cd5e98c84079fb48252ad9256a14bae6cfa5100f870\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3730, \"end_char_idx\": 5166, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "microsoft.com/Mail.Send: Send mail\n            https://graph.microsoft.com/Calendars.ReadWrite: Read and write user calendars\n  schemas:\n    UserProfile:\n      type: object\n      properties:\n        id:\n          type: string\n        displayName:\n          type: string\n        mail:\n          type: string\n    UserMessage:\n      type: object\n      properties:\n        id:\n          type: string\n        subject:\n          type: string\n        bodyPreview:\n          type: string\n    CalendarEvent:\n      type: object\n      properties:\n        id:\n          type: string\n        subject:\n          type: string\n        start:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n        end:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n    NewEvent:\n      type: object\n      properties:\n        subject:\n          type: string\n        start:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n        end:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n        attendees:\n          type: array\n          items:\n            type: object\n            properties:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: b36ed2b5-80f5-471d-b1cd-a3f4fc39c26a
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"b36ed2b5-80f5-471d-b1cd-a3f4fc39c26a\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"4754ce8f-2186-4fd2-9c3c-59aa047a628c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"4ffcd90a806a0e496bc34af295b9e31ff7fcd0ee4d499855f7b074f9799d63b9\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"8508eca8-4d9a-4baf-b441-e538ea22608f\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ec5eb6d57c2e44b50b4d6a3d852f5e134fa50613aa06fc593afd63a222f4a273\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4492, \"end_char_idx\": 5775, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "string\n        end:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n    NewEvent:\n      type: object\n      properties:\n        subject:\n          type: string\n        start:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n        end:\n          type: object\n          properties:\n            dateTime:\n              type: string\n            timeZone:\n              type: string\n        attendees:\n          type: array\n          items:\n            type: object\n            properties:\n              emailAddress:\n                type: object\n                properties:\n                  address:\n                    type: string\n                  name:\n                    type: string\n    SendMailRequest:\n      type: object\n      properties:\n        message:\n          type: object\n          properties:\n            subject:\n              type: string\n            body:\n              type: object\n              properties:\n                contentType:\n                  type: string\n                content:\n                  type: string\n            toRecipients:\n              type: array"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 8508eca8-4d9a-4baf-b441-e538ea22608f
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"8508eca8-4d9a-4baf-b441-e538ea22608f\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"b36ed2b5-80f5-471d-b1cd-a3f4fc39c26a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"63abfe447bd0709c44b1a8fab525c4b21f66ef3a6e3bf2f29970fa28596793b8\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"fc8976e2-8b86-40e3-b01b-18a3cafbd064\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"3bb256693656c9d0de236b7de5dfe1d3a85fd5a2b859e026c5e7b99414cb576b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5130, \"end_char_idx\": 6534, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "type: object\n            properties:\n              emailAddress:\n                type: object\n                properties:\n                  address:\n                    type: string\n                  name:\n                    type: string\n    SendMailRequest:\n      type: object\n      properties:\n        message:\n          type: object\n          properties:\n            subject:\n              type: string\n            body:\n              type: object\n              properties:\n                contentType:\n                  type: string\n                content:\n                  type: string\n            toRecipients:\n              type: array\n              items:\n                type: object\n                properties:\n                  emailAddress:\n                    type: object\n                    properties:\n                      address:\n                        type: string\nsecurity:\n  - OAuth2: []\npaths:\n  /me:\n    get:\n      operationId: getUserProfile\n      summary: Get the authenticated user's profile\n      security:\n        - OAuth2: []\n      responses:\n        '200':\n          description: A user profile\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/UserProfile'\n  /me/messages:\n    get:\n      operationId: getUserMessages\n      summary: Get the authenticated user's messages\n      security:\n        - OAuth2:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: fc8976e2-8b86-40e3-b01b-18a3cafbd064
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"fc8976e2-8b86-40e3-b01b-18a3cafbd064\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"8508eca8-4d9a-4baf-b441-e538ea22608f\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"629ec1c7d99a7b5c9f4c89cb7b2af8dba1d9f51b9db6a8e92af6f3983ad67780\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a49c6af0-16d8-4588-862f-1320f8a86231\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"10a9861089ebdfc4086d69071ae552f9975e509b588c12c6de4816f6a271e1e1\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5736, \"end_char_idx\": 7245, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "toRecipients:\n              type: array\n              items:\n                type: object\n                properties:\n                  emailAddress:\n                    type: object\n                    properties:\n                      address:\n                        type: string\nsecurity:\n  - OAuth2: []\npaths:\n  /me:\n    get:\n      operationId: getUserProfile\n      summary: Get the authenticated user's profile\n      security:\n        - OAuth2: []\n      responses:\n        '200':\n          description: A user profile\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/UserProfile'\n  /me/messages:\n    get:\n      operationId: getUserMessages\n      summary: Get the authenticated user's messages\n      security:\n        - OAuth2: []\n      parameters:\n        - name: $top\n          in: query\n          required: false\n          schema:\n            type: integer\n            default: 10\n            description: Number of messages to return\n        - name: $filter\n          in: query\n          required: false\n          schema:\n            type: string\n            description: OData filter query to narrow results\n        - name: $orderby\n          in: query\n          required: false\n          schema:\n            type: string\n            description: OData order by query to sort results\n      responses:\n        '200':\n          description: A list of user messages\n          content:\n            application/json:\n              schema:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: a49c6af0-16d8-4588-862f-1320f8a86231
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"a49c6af0-16d8-4588-862f-1320f8a86231\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"fc8976e2-8b86-40e3-b01b-18a3cafbd064\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f2ece9b2e2ae8207fb122c311c7e79d65ba6e1359e644fca15533636ed1ce129\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"342c5aa4-7b1d-4c0a-af82-b0ab4fa26cff\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"fea013b2de01f8239303e85fdb2ebdeeb803cde8818ac0da3908c6954e398624\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6454, \"end_char_idx\": 8076, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "summary: Get the authenticated user's messages\n      security:\n        - OAuth2: []\n      parameters:\n        - name: $top\n          in: query\n          required: false\n          schema:\n            type: integer\n            default: 10\n            description: Number of messages to return\n        - name: $filter\n          in: query\n          required: false\n          schema:\n            type: string\n            description: OData filter query to narrow results\n        - name: $orderby\n          in: query\n          required: false\n          schema:\n            type: string\n            description: OData order by query to sort results\n      responses:\n        '200':\n          description: A list of user messages\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/UserMessage'\n  /me/sendMail:\n    post:\n      operationId: sendUserMail\n      summary: Send an email as the authenticated user\n      security:\n        - OAuth2: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/SendMailRequest'\n      responses:\n        '202':\n          description: Accepted\n  /me/events:\n    get:\n      operationId: getUserCalendarEvents\n      summary: Get the authenticated user's calendar events\n      security:\n        - OAuth2: []\n      responses:\n        '200':\n          description: A list of calendar events\n          content:\n            application/json:\n              schema:\n                type: array"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 342c5aa4-7b1d-4c0a-af82-b0ab4fa26cff
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"342c5aa4-7b1d-4c0a-af82-b0ab4fa26cff\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a49c6af0-16d8-4588-862f-1320f8a86231\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1eb5d04e62b8287afe66f76a19fa69be80e5dfeeccc95587169e6fa3a89074c5\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"72858967-3477-4d9f-ad27-943963225902\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"fc68a576eff8fe3c447087dbb81d80f4c89ce63bf637114280983ce6aeca83eb\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7238, \"end_char_idx\": 8930, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/UserMessage'\n  /me/sendMail:\n    post:\n      operationId: sendUserMail\n      summary: Send an email as the authenticated user\n      security:\n        - OAuth2: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/SendMailRequest'\n      responses:\n        '202':\n          description: Accepted\n  /me/events:\n    get:\n      operationId: getUserCalendarEvents\n      summary: Get the authenticated user's calendar events\n      security:\n        - OAuth2: []\n      responses:\n        '200':\n          description: A list of calendar events\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/CalendarEvent'\n    post:\n      operationId: createUserCalendarEvent\n      summary: Create a new calendar event for the authenticated user\n      security:\n        - OAuth2: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewEvent'\n      responses:\n        '201':\n          description: Created\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/CalendarEvent'\n\n\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with Outlook. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 72858967-3477-4d9f-ad27-943963225902
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"72858967-3477-4d9f-ad27-943963225902\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"342c5aa4-7b1d-4c0a-af82-b0ab4fa26cff\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7cf44e6ceb5be8d921ccb098a704e98ecfca7b26aadefb5a8d5560e8d08c3cf3\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"71e60a16-17bb-4da6-ad39-1dd2cf2357b7\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b00cc2d556a1706e52baf0e1b65b0b906fbb0eda7faab1f339728938fb52b7d6\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7939, \"end_char_idx\": 10608, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "description: A list of calendar events\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: '#/components/schemas/CalendarEvent'\n    post:\n      operationId: createUserCalendarEvent\n      summary: Create a new calendar event for the authenticated user\n      security:\n        - OAuth2: []\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/NewEvent'\n      responses:\n        '201':\n          description: Created\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/CalendarEvent'\n\n\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with Outlook. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n### Azure Steps\n\n1. <b>App Registration</b>: The first step is to register a new App registration in the [Azure Portal](portal.azure.com) which will be used to integrate OAuth between our application and Azure Active Directory/Entra ID. Simply provide the application with a relevant name, leaving the Redirect URI blank for now as we will return to this, and save.\n\n![gptactions_outlook_registerapplication.png](../../../images/gptactions_outlook_registerapplication.png)\n\n2. <b>Certificate & Secrets</b>: We next need to generate a client secret to provide secure communication between the GPT and Azure. Within the App registration, navigate to <b>Certificate & secrets</b> in the sidebar\n\n![gptactions_outlook_secrets.png](../../../images/gptactions_outlook_secrets.png)\n\nClick New client secret and create a new client secret with desired name and expiry date. Clicking save will provide us a Secret to use in our GPT creation. Make sure to save the **Value** field as it\u2019ll only be visible at creation, and we will need it later!\n\n![gptactions_outlook_secretvalue.png](../../../images/gptactions_outlook_secretvalue.png)\n\n3. <b>API Permissions</b>: The next step is to provide the integration with the scope it needs to perform our specific required actions. \nWithin the App registration, navigate to <b>Manage > API permissions</b> in the sidebar. \n\n![gptactions_outlook_permissions.png](../../../images/gptactions_outlook_permissions.png)\n\nClick <b>Add a permission</b> and <b>Microsoft graph > Delegated Permissions</b> as options in the opened side menu. Use the search bar to add the following permissions:\n- Calendars.ReadWrite\n- Mail.Read\n- Mail.Send\n- User.Read"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 71e60a16-17bb-4da6-ad39-1dd2cf2357b7
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"71e60a16-17bb-4da6-ad39-1dd2cf2357b7\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"72858967-3477-4d9f-ad27-943963225902\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"4d0931cecfb6fd0e6250841148330b187cb276037ded38e28f64a53e5b2eab3d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"fcbdedec-cad0-4aa0-94c1-c8bfc92f331b\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6f0574bd37adb7d85332c3f6b956dc41096de5c7cbda9aed30296218fa0c41eb\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8933, \"end_char_idx\": 11981, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "### Azure Steps\n\n1. <b>App Registration</b>: The first step is to register a new App registration in the [Azure Portal](portal.azure.com) which will be used to integrate OAuth between our application and Azure Active Directory/Entra ID. Simply provide the application with a relevant name, leaving the Redirect URI blank for now as we will return to this, and save.\n\n![gptactions_outlook_registerapplication.png](../../../images/gptactions_outlook_registerapplication.png)\n\n2. <b>Certificate & Secrets</b>: We next need to generate a client secret to provide secure communication between the GPT and Azure. Within the App registration, navigate to <b>Certificate & secrets</b> in the sidebar\n\n![gptactions_outlook_secrets.png](../../../images/gptactions_outlook_secrets.png)\n\nClick New client secret and create a new client secret with desired name and expiry date. Clicking save will provide us a Secret to use in our GPT creation. Make sure to save the **Value** field as it\u2019ll only be visible at creation, and we will need it later!\n\n![gptactions_outlook_secretvalue.png](../../../images/gptactions_outlook_secretvalue.png)\n\n3. <b>API Permissions</b>: The next step is to provide the integration with the scope it needs to perform our specific required actions. \nWithin the App registration, navigate to <b>Manage > API permissions</b> in the sidebar. \n\n![gptactions_outlook_permissions.png](../../../images/gptactions_outlook_permissions.png)\n\nClick <b>Add a permission</b> and <b>Microsoft graph > Delegated Permissions</b> as options in the opened side menu. Use the search bar to add the following permissions:\n- Calendars.ReadWrite\n- Mail.Read\n- Mail.Send\n- User.Read\n\n\n![gptactions_outlook_permissionadd.png](../../../images/gptactions_outlook_permissionadd.png)\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: The value listed on the Azure Registered App\u2019s Overview page under **Application (client) ID**\n- **Client Secret**: the secret **Value** saved from step 2 of **Azure Steps**\n\nFor the following two inputs, replace <Tenant_ID> with the value listed on the Registered App\u2019s Overview page under **Directory (tenant) ID**\n\n- **Authorization URL**: https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/authorize\n- **Token URL**: https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/token\n- **Scope**: https://graph.microsoft.com/User.Read https://graph.microsoft.com/Mail.Send https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/Calendars.ReadWrite \n- **Token Exchange Method**: Default (POST Request)\n\n### Post-Action Steps\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n\n![gptactions_outlook_callback.png](../../../images/gptactions_outlook_callback.png)\n\n- In the Azure app, navigate to the **Manage > Authentication** tab, click **Add a platform**, select **Web** and add your callback URL under **Redirect URI**"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: fcbdedec-cad0-4aa0-94c1-c8bfc92f331b
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb", "title": "GPT Action Library: Outlook", "tokens": 2589, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"fcbdedec-cad0-4aa0-94c1-c8bfc92f331b\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"999828f9-ac19-4917-830d-dd556f7fe5d5\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"48e0564ce23c788b9fbae87b41633a7d05f223c1a1ffb3a8c302dcf9045613c7\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"71e60a16-17bb-4da6-ad39-1dd2cf2357b7\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_outlook.ipynb\", \"title\": \"GPT Action Library: Outlook\", \"tokens\": 2589, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"695ec312dddf3a8bf48d1fe26779979e6dacf6214c90a28157062f1253f8852a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10611, \"end_char_idx\": 12549, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "ref_doc_id": "999828f9-ac19-4917-830d-dd556f7fe5d5", "chroma:document": "![gptactions_outlook_permissionadd.png](../../../images/gptactions_outlook_permissionadd.png)\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: The value listed on the Azure Registered App\u2019s Overview page under **Application (client) ID**\n- **Client Secret**: the secret **Value** saved from step 2 of **Azure Steps**\n\nFor the following two inputs, replace <Tenant_ID> with the value listed on the Registered App\u2019s Overview page under **Directory (tenant) ID**\n\n- **Authorization URL**: https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/authorize\n- **Token URL**: https://login.microsoftonline.com/<Tenant_ID>/oauth2/v2.0/token\n- **Scope**: https://graph.microsoft.com/User.Read https://graph.microsoft.com/Mail.Send https://graph.microsoft.com/Mail.Read https://graph.microsoft.com/Calendars.ReadWrite \n- **Token Exchange Method**: Default (POST Request)\n\n### Post-Action Steps\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n\n![gptactions_outlook_callback.png](../../../images/gptactions_outlook_callback.png)\n\n- In the Azure app, navigate to the **Manage > Authentication** tab, click **Add a platform**, select **Web** and add your callback URL under **Redirect URI**\n\n\n![gptactions_outlook_redirectconfig.png](../../../images/gptactions_outlook_redirectconfig.png)\n![gptactions_outlook_redirectinput.png](../../../images/gptactions_outlook_redirectinput.png)\n\n### FAQ & Troubleshooting\n\n- **Callback URL Error**: If you get a callback URL error in ChatGPT, double check the Callback URL value as it can occasionally change depending on any alterations made to the authentication\n\n\n*Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look.*"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: e8c4dc23-f8ac-4b47-87e9-233eb0d738fc
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"e8c4dc23-f8ac-4b47-87e9-233eb0d738fc\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ba938e9c-1a8b-4f58-bd93-b53d3c61bba8\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"a7d83ad230ef94e4a9ea5c98627bc5a9ca57aeba9edf2f8a21504456e2d130a5\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2066, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "# GPT Action Library: SQL Database\n\n\n## Introduction\n\nThis is a guide for developers seeking to give ChatGPT the ability to query a SQL database using a GPT Action. Before reading this guide, please familiarize yourself with the following content:\n\n\n\n* [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n* [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n* [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis guide outlines the workflow required to connect ChatGPT to a SQL Database via a middleware application. We\u2019ll use a PostgreSQL database for this example, but the process should be similar for all SQL databases (MySQL, MS SQL Server, Amazon Aurora, SQL Server on Google Cloud, etc.). This documentation outlines the steps required to create GPT Action which can:\n\n\n\n* Execute read queries against a SQL Database\n* Return records via a text response\n* Return records via a CSV file\n\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to answer questions about data in a SQL database:\n\n\n\n* Business users can access information contained in a SQL database without writing SQL or submitting a request to an analyst\n* Data analysts can perform complex analysis beyond what is possible with a SQL query by extracting data and analyzing it with ChatGPT\n\n**Example Use Cases**:\n\n\n\n* A business user needs to answer questions about their sales funnel\n* A data analyst needs to perform a regression analysis on a large dataset\n\n\n## Application Design Considerations\n\nGiven that most managed SQL databases do not provide REST APIs for submitting queries, you will need a middleware application to perform the following functions:\n\n\n\n1. Accept database queries via REST API requests\n2. Forward queries to the integrated SQL database\n3. Convert database responses in to CSV files\n4. Return CSV files to the requestor\n\nThere are two main approaches to designing the first function:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: ba938e9c-1a8b-4f58-bd93-b53d3c61bba8
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"ba938e9c-1a8b-4f58-bd93-b53d3c61bba8\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"e8c4dc23-f8ac-4b47-87e9-233eb0d738fc\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f49c7f385ab95625ff65101ee7ef296d5a8cc1773de802c548643234dc67566f\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ffe668e3-f86a-4a3c-8b34-2aa872b25739\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"40259603045d236c5c32859ef3cdcb0120f625da41a18c0f88c2278c69782532\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 251, \"end_char_idx\": 3966, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "* [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n* [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n* [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis guide outlines the workflow required to connect ChatGPT to a SQL Database via a middleware application. We\u2019ll use a PostgreSQL database for this example, but the process should be similar for all SQL databases (MySQL, MS SQL Server, Amazon Aurora, SQL Server on Google Cloud, etc.). This documentation outlines the steps required to create GPT Action which can:\n\n\n\n* Execute read queries against a SQL Database\n* Return records via a text response\n* Return records via a CSV file\n\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to answer questions about data in a SQL database:\n\n\n\n* Business users can access information contained in a SQL database without writing SQL or submitting a request to an analyst\n* Data analysts can perform complex analysis beyond what is possible with a SQL query by extracting data and analyzing it with ChatGPT\n\n**Example Use Cases**:\n\n\n\n* A business user needs to answer questions about their sales funnel\n* A data analyst needs to perform a regression analysis on a large dataset\n\n\n## Application Design Considerations\n\nGiven that most managed SQL databases do not provide REST APIs for submitting queries, you will need a middleware application to perform the following functions:\n\n\n\n1. Accept database queries via REST API requests\n2. Forward queries to the integrated SQL database\n3. Convert database responses in to CSV files\n4. Return CSV files to the requestor\n\nThere are two main approaches to designing the first function:\n\n\n\n1. The middleware supports a single method for receiving arbitrary SQL queries generated by the GPT and forwards them to the database. The benefits of this approach include:\n    1. Ease of development\n    2. Flexibility (doesn\u2019t require you to anticipate the types of queries users will make)\n    3. Low maintenance (doesn\u2019t require you to update the API schema in response to database changes)\n2. The middleware supports a number of methods corresponding to specific allowed queries. The benefits of this approach include:\n    4. More control\n    5. Less opportunity for model error when generating SQL\n\nThis guide will focus on option 1. For those interested in option 2, consider implementing a service like [PostgREST](https://github.com/PostgREST/postgrest) or [Hasura](https://hasura.io/) to streamline the process.\n\n![An application architecture diagram depicting the interaction between the user, GPT, middleware, and database](../../../images/gptactions_sql_database_middleware.png)\n_Application architecture diagram_\n\n## Middleware Considerations\n\nDevelopers can either build custom middleware (commonly deployed as serverless functions with CSPs like AWS, GCP, or MS Azure) or use third-party solutions (like [Mulesoft Anypoint](https://www.mulesoft.com/platform/enterprise-integration) or [Retool Workflows](https://retool.com/products/workflows)). Using third-party middleware can accelerate your development process, but is less flexible than building it yourself.\n\nBuilding your own middleware gives you more control over the application\u2019s behavior. For an example of custom middleware, see our [Azure Functions cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_azure_function).\n\nRather than focusing on the specifics of middleware setup, this guide will focus on the middleware\u2019s interface with the GPT and SQL database.\n\n\n## Workflow Steps"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: ffe668e3-f86a-4a3c-8b34-2aa872b25739
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"ffe668e3-f86a-4a3c-8b34-2aa872b25739\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ba938e9c-1a8b-4f58-bd93-b53d3c61bba8\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"0ff1dafc617223a30dd1c53bd03e4ef0c5b6fb76b754808ca27dd8820e5b4cb1\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"aed6a696-01e2-4c37-b676-fb72cd4cd6d6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"90b217afb230ad5efd1daeb1413d5c5ae760ef9f60e9649b24c116c4cecb62fa\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2070, \"end_char_idx\": 4659, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "1. The middleware supports a single method for receiving arbitrary SQL queries generated by the GPT and forwards them to the database. The benefits of this approach include:\n    1. Ease of development\n    2. Flexibility (doesn\u2019t require you to anticipate the types of queries users will make)\n    3. Low maintenance (doesn\u2019t require you to update the API schema in response to database changes)\n2. The middleware supports a number of methods corresponding to specific allowed queries. The benefits of this approach include:\n    4. More control\n    5. Less opportunity for model error when generating SQL\n\nThis guide will focus on option 1. For those interested in option 2, consider implementing a service like [PostgREST](https://github.com/PostgREST/postgrest) or [Hasura](https://hasura.io/) to streamline the process.\n\n![An application architecture diagram depicting the interaction between the user, GPT, middleware, and database](../../../images/gptactions_sql_database_middleware.png)\n_Application architecture diagram_\n\n## Middleware Considerations\n\nDevelopers can either build custom middleware (commonly deployed as serverless functions with CSPs like AWS, GCP, or MS Azure) or use third-party solutions (like [Mulesoft Anypoint](https://www.mulesoft.com/platform/enterprise-integration) or [Retool Workflows](https://retool.com/products/workflows)). Using third-party middleware can accelerate your development process, but is less flexible than building it yourself.\n\nBuilding your own middleware gives you more control over the application\u2019s behavior. For an example of custom middleware, see our [Azure Functions cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_azure_function).\n\nRather than focusing on the specifics of middleware setup, this guide will focus on the middleware\u2019s interface with the GPT and SQL database.\n\n\n## Workflow Steps\n\n\n### 1) GPT generates a SQL query\n\nGPTs are very good at writing SQL queries based on a user\u2019s natural language prompt. You can improve the GPT\u2019s query generation capabilities by giving it access to the database schema in one of the following ways:\n\n\n\n1. Instruct the GPT to start by querying the database to retrieve the schema (this approach is demonstrated in more detail in our [BigQuery cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_action_bigquery#custom-gpt-instructions)).\n2. Provide the schema in the GPT instructions (works best for small, static schemata)\n\nHere are sample GPT instructions which include information about a simple database schema:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: aed6a696-01e2-4c37-b676-fb72cd4cd6d6
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"aed6a696-01e2-4c37-b676-fb72cd4cd6d6\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ffe668e3-f86a-4a3c-8b34-2aa872b25739\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f8cd916930f187e97c381bce48aea8f82cdf6e6af51000ca2c30d07e596ba521\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d302b605-b936-4348-9cfa-74067d29827b\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"abc124459e1182c86ac3cb4401e359328028ecef562084cd27a64572f9db33a2\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3949, \"end_char_idx\": 8274, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "## Workflow Steps\n\n\n### 1) GPT generates a SQL query\n\nGPTs are very good at writing SQL queries based on a user\u2019s natural language prompt. You can improve the GPT\u2019s query generation capabilities by giving it access to the database schema in one of the following ways:\n\n\n\n1. Instruct the GPT to start by querying the database to retrieve the schema (this approach is demonstrated in more detail in our [BigQuery cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_action_bigquery#custom-gpt-instructions)).\n2. Provide the schema in the GPT instructions (works best for small, static schemata)\n\nHere are sample GPT instructions which include information about a simple database schema:\n\n\n\n```python\n# Context\nYou are a data analyst. Your job is to assist users with their business questions by analyzing the data contained in a PostgreSQL database.\n\n## Database Schema\n\n### Accounts Table\n**Description:** Stores information about business accounts.\n\n| Column Name  | Data Type      | Constraints                        | Description                             |\n|--------------|----------------|------------------------------------|-----------------------------------------|\n| account_id   | INT            | PRIMARY KEY, AUTO_INCREMENT, NOT NULL | Unique identifier for each account      |\n| account_name | VARCHAR(255)   | NOT NULL                           | Name of the business account            |\n| industry     | VARCHAR(255)   |                                    | Industry to which the business belongs  |\n| created_at   | TIMESTAMP      | NOT NULL, DEFAULT CURRENT_TIMESTAMP | Timestamp when the account was created  |\n\n### Users Table\n**Description:** Stores information about users associated with the accounts.\n\n| Column Name  | Data Type      | Constraints                        | Description                             |\n|--------------|----------------|------------------------------------|-----------------------------------------|\n| user_id      | INT            | PRIMARY KEY, AUTO_INCREMENT, NOT NULL | Unique identifier for each user         |\n| account_id   | INT            | NOT NULL, FOREIGN KEY (References Accounts(account_id)) | Foreign key referencing Accounts(account_id) |\n| username     | VARCHAR(50)    | NOT NULL, UNIQUE                   | Username chosen by the user             |\n| email        | VARCHAR(100)   | NOT NULL, UNIQUE                   | User's email address                    |\n| role         | VARCHAR(50)    |                                    | Role of the user within the account     |\n| created_at   | TIMESTAMP      | NOT NULL, DEFAULT CURRENT_TIMESTAMP | Timestamp when the user was created     |\n\n### Revenue Table\n**Description:** Stores revenue data related to the accounts.\n\n| Column Name  | Data Type      | Constraints                        | Description                             |\n|--------------|----------------|------------------------------------|-----------------------------------------|\n| revenue_id   | INT            | PRIMARY KEY, AUTO_INCREMENT, NOT NULL | Unique identifier for each revenue record |\n| account_id   | INT            | NOT NULL, FOREIGN KEY (References Accounts(account_id)) | Foreign key referencing Accounts(account_id) |\n| amount       | DECIMAL(10, 2) | NOT NULL                           | Revenue amount                          |\n| revenue_date | DATE           | NOT NULL                           | Date when the revenue was recorded      |\n\n# Instructions:\n1. When the user asks a question, consider what data you would need to answer the question and confirm that the data should be available by consulting the database schema.\n2. Write a PostgreSQL-compatible query and submit it using the `databaseQuery` API method.\n3. Use the response data to answer the user's question.\n4. If necessary, use code interpreter to perform additional analysis on the data until you are able to answer the user's question.\n```\n\n### 2) GPT sends SQL query to middleware\n\nIn order for our GPT to communicate with our middleware, we\u2019ll configure a GPT Action. The middleware needs to present a REST API endpoint which accepts a SQL query string. You can design this interface in several ways. Here is an example of an OpenAPI schema for a simple endpoint which accepts a \u201cq\u201d parameter in a POST operation:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: d302b605-b936-4348-9cfa-74067d29827b
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"d302b605-b936-4348-9cfa-74067d29827b\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"aed6a696-01e2-4c37-b676-fb72cd4cd6d6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ade196545d3e61f69b2e53038e35ebd426c2a4f3460dff7f167fa68ccd27507e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"61b4729e-4a91-43e3-ae12-44f0881ebc6a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e92327fb8a8bf6da4da96f08b923eeb8af26743810b578971e82360eaa627f79\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8277, \"end_char_idx\": 11361, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "```python\nopenapi: 3.1.0\ninfo:\n  title: PostgreSQL API\n  description: API for querying a PostgreSQL database\n  version: 1.0.0\nservers:\n  - url: https://my.middleware.com/v1\n    description: middleware service\npaths:\n  /api/query:\n    post:\n      operationId: databaseQuery\n      summary: Query a PostgreSQL database\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                q:\n                  type: string\n                  example: select * from users\n      responses:\n        \"200\":\n          description: database records\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  openaiFileResponse:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n                          description: The name of the file.\n                        mime_type:\n                          type: string\n                          description: The MIME type of the file.\n                        content:\n                          type: string\n                          format: byte\n                          description: The content of the file in base64 encoding.\n        \"400\":\n          description: Bad Request. Invalid input.\n        \"401\":\n          description: Unauthorized. Invalid or missing API key.\n      security:\n        - ApiKey: []\ncomponents:\n  securitySchemes:\n    ApiKey:\n      type: apiKey\n      in: header\n      name: X-Api-Key\n  schemas: {}\n```\n\n**A note on authentication:** The API interface in the above example accepts a single system-level API key which is stored along with the GPT\u2019s configuration and used to authenticate requests for all GPT users. GPT Actions also support OAuth authentication, which enables user-level authentication and authorization. [Learn more about GPT Action authentication options](https://platform.openai.com/docs/actions/authentication).\n\nBecause the user is authenticating with middleware and not directly with the underlying database, enforcing user-level access (table or row-level permissions) requires more effort. However, it may be required for GPTs where users have different levels of access to the underlying database.\n\n In order to enforce user-level permissions, your middleware should:\n\n\n\n1. Receive the user\u2019s metadata provided by the IdP during the OAuth flow and extract their identifying information\n2. Query the database to retrieve the user\u2019s database permissions\n3. Issue a command to the database to enforce the relevant permissions for the remainder of the session\n\nIn order to maintain a good user experience, you\u2019ll want to dynamically retrieve the available database schema for each user as opposed to including the schema data in the GPT instructions directly. This ensures that the GPT only has access to tables which it can query on behalf of the current user."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 61b4729e-4a91-43e3-ae12-44f0881ebc6a
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"61b4729e-4a91-43e3-ae12-44f0881ebc6a\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d302b605-b936-4348-9cfa-74067d29827b\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"a7a3ebda729ed2990daaffe8041818670fa9dbb0772d8bde5fe3591125488e7d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"9ba1638a-d52a-4712-9a75-40ad48c24704\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"10241ec8687ed6c12b17acf12dfc78062ca6cc5419b4e77f4f14d7a6897d1f38\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10775, \"end_char_idx\": 13895, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "1. Receive the user\u2019s metadata provided by the IdP during the OAuth flow and extract their identifying information\n2. Query the database to retrieve the user\u2019s database permissions\n3. Issue a command to the database to enforce the relevant permissions for the remainder of the session\n\nIn order to maintain a good user experience, you\u2019ll want to dynamically retrieve the available database schema for each user as opposed to including the schema data in the GPT instructions directly. This ensures that the GPT only has access to tables which it can query on behalf of the current user.\n\n\n### 3) Middleware forwards SQL query to database \n\nYour middleware will implement a database driver or client library to enable it to query the PostgreSQL database directly. If you are using third-party middleware, the middleware vendor should provide native connectors for SQL databases. If you are building your own middleware, you may need to implement a client library provided by the database vendor or a third-party. For example, here is a list of community-maintained client libraries for PostgreSQL: [https://wiki.postgresql.org/wiki/List_of_drivers](https://wiki.postgresql.org/wiki/List_of_drivers)\n\nDuring this workflow step, the middleware application needs to extract the SQL string from the request it received from the GPT and forward it to the database using the methods provided by the client library.\n\n**A note on read-only permissions:** Given that this design pattern results in your database processing arbitrary AI-generated SQL queries, you should ensure that the middleware application has read-only permissions on the database. This ensures that the AI-generated queries cannot insert new data or modify existing data. If write access is required for your use-case, consider deploying operation-specific endpoints rather than accepting arbitrary SQL.\n\n\n### 4) Database returns records to middleware\n\nDepending on the client library you have implemented, your middleware may receive records in a variety of formats. One common pattern is for your middleware to receive an array of JSON objects, each object representing a database record matching the query:\n\n\n\n```python\n[\n  {\n    \"account_id\": 1,\n    \"number_of_users\": 10,\n    \"total_revenue\": 43803.96,\n    \"revenue_per_user\": 4380.40\n  },\n  {\n    \"account_id\": 2,\n    \"number_of_users\": 12,\n    \"total_revenue\": 77814.84,\n    \"revenue_per_user\": 6484.57\n  },\n  ...\n]\n```\n\n### 5) Middleware converts records into base64-encoded CSV file\n\nIn order for ChatGPT to analyze large numbers of records, it needs access to data in a CSV format. The GPT Actions interface allows GPTs to [receive base64-encoded files](https://platform.openai.com/docs/actions/sending-files/returning-files) of up to 10mb in size.\n\nYour middleware needs to perform two actions:\n\n\n#### Convert records into a CSV format\n\nMany programming languages include a native library for working with CSV files (the Python [csv](https://docs.python.org/3/library/csv.html) library, for example).\n\nHere\u2019s an example of how your middleware could convert an array of JSON objects into a CSV file:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 9ba1638a-d52a-4712-9a75-40ad48c24704
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"9ba1638a-d52a-4712-9a75-40ad48c24704\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"61b4729e-4a91-43e3-ae12-44f0881ebc6a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"85f52ca0316c2972b9d85e0d83d93f47b3b421b101b3ace33e96fada610c29b2\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"52cdcde8-7986-4a6e-b922-f95e06eeda5e\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"2e519691cfe07e917e7a7b9b0f7881f007a8d198e6c715c5740f6dd0caecf7ad\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 12642, \"end_char_idx\": 15018, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "### 4) Database returns records to middleware\n\nDepending on the client library you have implemented, your middleware may receive records in a variety of formats. One common pattern is for your middleware to receive an array of JSON objects, each object representing a database record matching the query:\n\n\n\n```python\n[\n  {\n    \"account_id\": 1,\n    \"number_of_users\": 10,\n    \"total_revenue\": 43803.96,\n    \"revenue_per_user\": 4380.40\n  },\n  {\n    \"account_id\": 2,\n    \"number_of_users\": 12,\n    \"total_revenue\": 77814.84,\n    \"revenue_per_user\": 6484.57\n  },\n  ...\n]\n```\n\n### 5) Middleware converts records into base64-encoded CSV file\n\nIn order for ChatGPT to analyze large numbers of records, it needs access to data in a CSV format. The GPT Actions interface allows GPTs to [receive base64-encoded files](https://platform.openai.com/docs/actions/sending-files/returning-files) of up to 10mb in size.\n\nYour middleware needs to perform two actions:\n\n\n#### Convert records into a CSV format\n\nMany programming languages include a native library for working with CSV files (the Python [csv](https://docs.python.org/3/library/csv.html) library, for example).\n\nHere\u2019s an example of how your middleware could convert an array of JSON objects into a CSV file:\n\n\n```python\nimport json\nimport csv\n\n# Sample JSON array of objects\njson_data = '''\n[\n    {\"account_id\": 1, \"number_of_users\": 10, \"total_revenue\": 43803.96, \"revenue_per_user\": 4380.40}, \n    {\"account_id\": 2, \"number_of_users\": 12, \"total_revenue\": 77814.84, \"revenue_per_user\": 6484.57}\n]\n'''\n\n# Load JSON data\ndata = json.loads(json_data)\n\n# Define the CSV file name\ncsv_file = 'output.csv'\n\n# Write JSON data to CSV\nwith open(csv_file, 'w', newline='') as csvfile:\n    # Create a CSV writer object\n    csvwriter = csv.writer(csvfile)\n    \n    # Write the header (keys of the first dictionary)\n    header = data[0].keys()\n    csvwriter.writerow(header)\n    \n    # Write the data rows\n    for row in data:\n        csvwriter.writerow(row.values())\n\nprint(f\"JSON data has been written to {csv_file}\")\n```\n\n#### Base64-encode the CSV file\n\nMany programming languages include a native library for working with base64 encodings (the Python [base64](https://docs.python.org/3/library/base64.html) library, for example).\n\nHere\u2019s an example of how your middleware could base64-encode the CSV file generated in the previous step:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 52cdcde8-7986-4a6e-b922-f95e06eeda5e
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"52cdcde8-7986-4a6e-b922-f95e06eeda5e\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"9ba1638a-d52a-4712-9a75-40ad48c24704\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ac5369d475de5d9e8718f4fd0f442b32e4af564d438bead71786ced7a2285cdb\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"7599b5e4-ea13-4f1f-9479-dc00e1826306\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"cb62f115ae0a3fa11b9eabf42a4056fabbf2347ec0b04f71aff87ab8affab7b9\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 13594, \"end_char_idx\": 16545, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "#### Convert records into a CSV format\n\nMany programming languages include a native library for working with CSV files (the Python [csv](https://docs.python.org/3/library/csv.html) library, for example).\n\nHere\u2019s an example of how your middleware could convert an array of JSON objects into a CSV file:\n\n\n```python\nimport json\nimport csv\n\n# Sample JSON array of objects\njson_data = '''\n[\n    {\"account_id\": 1, \"number_of_users\": 10, \"total_revenue\": 43803.96, \"revenue_per_user\": 4380.40}, \n    {\"account_id\": 2, \"number_of_users\": 12, \"total_revenue\": 77814.84, \"revenue_per_user\": 6484.57}\n]\n'''\n\n# Load JSON data\ndata = json.loads(json_data)\n\n# Define the CSV file name\ncsv_file = 'output.csv'\n\n# Write JSON data to CSV\nwith open(csv_file, 'w', newline='') as csvfile:\n    # Create a CSV writer object\n    csvwriter = csv.writer(csvfile)\n    \n    # Write the header (keys of the first dictionary)\n    header = data[0].keys()\n    csvwriter.writerow(header)\n    \n    # Write the data rows\n    for row in data:\n        csvwriter.writerow(row.values())\n\nprint(f\"JSON data has been written to {csv_file}\")\n```\n\n#### Base64-encode the CSV file\n\nMany programming languages include a native library for working with base64 encodings (the Python [base64](https://docs.python.org/3/library/base64.html) library, for example).\n\nHere\u2019s an example of how your middleware could base64-encode the CSV file generated in the previous step:\n\n\n```python\nimport base64 \n\n# Base64 encode the CSV file\nencoded_string = base64.b64encode(open('output.csv', 'rb').read()).decode('utf-8')\n\nprint(\"Base64 Encoded CSV:\")\nprint(encoded_string)\n```\n\n### 6) Middleware returns base64-encoded CSV file to GPT\n\nIn order for the GPT Actions interface to process the base-64 encoded CSV file, the response returned by your middleware must contain an `openaiFileResponse` parameter. The value provided must be an array of file objects or links to files (see the [Actions documentation](https://platform.openai.com/docs/actions/sending-files/returning-files) for more details). For the purposes of this example, we will work with an array of file objects.\n\nHere is an example of what a valid response body looks like:\n\n\n```python\n{\n  \"openaiFileResponse\": [\n    {\n      \"name\": \"output.csv\",\n      \"mime_type\": \"text/csv\",\n      \"content\": \"ImFjY291bn...NC41NyI=\"\n    }\n  ]\n}\n```\n\n### 7) GPT processes returned file\n\nOnce your GPT receives the base64-encoded CSV file, it will automatically decode the file and process it to answer the user\u2019s question. This may involve using [code interpreter to perform additional analysis](https://help.openai.com/en/articles/9213685-extracting-insights-with-chatgpt-data-analysis) against the CSV file, which happens the same way as if a user had uploaded the CSV file via the prompt.\n\n**Note:** You must enable the _Code Interpreter & Data Analysis_ capability in your GPT if you want to be able to perform additional analysis on the returned file."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 7599b5e4-ea13-4f1f-9479-dc00e1826306
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb", "title": "GPT Action Library: SQL Database", "tokens": 3451, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"7599b5e4-ea13-4f1f-9479-dc00e1826306\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"95818e88-591e-4700-8d51-30504681e0c3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3da55fe1bc54e7f0b2f49fdc16d6bbdcf77f6e938cc326caf225f6eb84bc427d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"52cdcde8-7986-4a6e-b922-f95e06eeda5e\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sql_database.ipynb\", \"title\": \"GPT Action Library: SQL Database\", \"tokens\": 3451, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7f850eca519ec462f3eb549f771a9243d009bb44d495f92b3d5d9017693d7374\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 15021, \"end_char_idx\": 16947, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "95818e88-591e-4700-8d51-30504681e0c3", "doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "ref_doc_id": "95818e88-591e-4700-8d51-30504681e0c3", "chroma:document": "```python\nimport base64 \n\n# Base64 encode the CSV file\nencoded_string = base64.b64encode(open('output.csv', 'rb').read()).decode('utf-8')\n\nprint(\"Base64 Encoded CSV:\")\nprint(encoded_string)\n```\n\n### 6) Middleware returns base64-encoded CSV file to GPT\n\nIn order for the GPT Actions interface to process the base-64 encoded CSV file, the response returned by your middleware must contain an `openaiFileResponse` parameter. The value provided must be an array of file objects or links to files (see the [Actions documentation](https://platform.openai.com/docs/actions/sending-files/returning-files) for more details). For the purposes of this example, we will work with an array of file objects.\n\nHere is an example of what a valid response body looks like:\n\n\n```python\n{\n  \"openaiFileResponse\": [\n    {\n      \"name\": \"output.csv\",\n      \"mime_type\": \"text/csv\",\n      \"content\": \"ImFjY291bn...NC41NyI=\"\n    }\n  ]\n}\n```\n\n### 7) GPT processes returned file\n\nOnce your GPT receives the base64-encoded CSV file, it will automatically decode the file and process it to answer the user\u2019s question. This may involve using [code interpreter to perform additional analysis](https://help.openai.com/en/articles/9213685-extracting-insights-with-chatgpt-data-analysis) against the CSV file, which happens the same way as if a user had uploaded the CSV file via the prompt.\n\n**Note:** You must enable the _Code Interpreter & Data Analysis_ capability in your GPT if you want to be able to perform additional analysis on the returned file.\n\n\n## Conclusion\n\nGPT Actions provide a flexible framework for retrieving data from external sources like SQL databases. Giving ChatGPT the ability to query a database can substantially expand its capabilities as a knowledge assistant and analyst.\n\n_Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look._"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: a99a17ab-c980-4bbe-9fbc-c682578752cd
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb", "title": "GPT Action Library: Getting Started (Weather.gov)", "tokens": 1288, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"a99a17ab-c980-4bbe-9fbc-c682578752cd\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb\", \"title\": \"GPT Action Library: Getting Started (Weather.gov)\", \"tokens\": 1288, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"16a8d921-b074-431b-97fb-c15eb4bfdff3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb\", \"title\": \"GPT Action Library: Getting Started (Weather.gov)\", \"tokens\": 1288, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f459f15977189f279196070cda878cc0a04a947125ae342a483161544d9649e3\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"9ef3ffcf-53e6-46de-b6d1-5e6997e03030\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ffe96ad6abf53e8a41fccf2319a8cb2f8d7ba72917a8db7976cf78034d1a7f66\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3049, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "16a8d921-b074-431b-97fb-c15eb4bfdff3", "doc_id": "16a8d921-b074-431b-97fb-c15eb4bfdff3", "ref_doc_id": "16a8d921-b074-431b-97fb-c15eb4bfdff3", "chroma:document": "# GPT Action Library: Getting Started (Weather.gov)\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Buliding a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to a **Weather.gov** weather forecast. This Action takes a user\u2019s question about a location, converts the lat-long into a weather forecast office (WFO), x, and y coordinates, then converts those 3 values into a weather forecast.\n\nNote: When setting up the GPT Action, for authentication, leave it with \"None\". This is a public API and does not require any Authentication\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to forecast the weather\n\n**Example Use Cases**: \n- Users can plan out their day based on weather patterns\n- Users can quickly visualize (including graphs) what the weather is forecasted to look like\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://www.weather.gov/  \n- Application API Documentation: https://www.weather.gov/documentation/services-web-api  \n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\n**Context**: A user needs information related to a weather forecast of a specific location.\n\n**Instructions**:\n1. The user will provide a lat-long point or a general location or landmark (e.g. New York City, the White House). If the user does not provide one, ask for the relevant location\n2. If the user provides a general location or landmark, convert that into a lat-long coordinate. If required, browse the web to look up the lat-long point. \n3. Run the \"getPointData\" API action and retrieve back the gridId, gridX, and gridY parameters.\n4. Apply those variables as the office, gridX, and gridY variables in the \"getGridpointForecast\" API action to retrieve back a forecast\n5. Use that forecast to answer the user's question \n\n**Additional Notes**: \n- Assume the user uses US weather units (e.g. Farenheit) unless otherwise specified\n- If the user says \"Let's get started\" or \"What do I do?\", explain the purpose of this Custom GPT\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 9ef3ffcf-53e6-46de-b6d1-5e6997e03030
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb", "title": "GPT Action Library: Getting Started (Weather.gov)", "tokens": 1288, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"9ef3ffcf-53e6-46de-b6d1-5e6997e03030\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb\", \"title\": \"GPT Action Library: Getting Started (Weather.gov)\", \"tokens\": 1288, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"16a8d921-b074-431b-97fb-c15eb4bfdff3\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb\", \"title\": \"GPT Action Library: Getting Started (Weather.gov)\", \"tokens\": 1288, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f459f15977189f279196070cda878cc0a04a947125ae342a483161544d9649e3\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a99a17ab-c980-4bbe-9fbc-c682578752cd\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/.gpt_action_getting_started.ipynb\", \"title\": \"GPT Action Library: Getting Started (Weather.gov)\", \"tokens\": 1288, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"abd82f2bca2a2f5e54b92ad55d24d28aa99ae3497abe90bd38fa1d859872af32\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 1848, \"end_char_idx\": 6839, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "16a8d921-b074-431b-97fb-c15eb4bfdff3", "doc_id": "16a8d921-b074-431b-97fb-c15eb4bfdff3", "ref_doc_id": "16a8d921-b074-431b-97fb-c15eb4bfdff3", "chroma:document": "```python\n**Context**: A user needs information related to a weather forecast of a specific location.\n\n**Instructions**:\n1. The user will provide a lat-long point or a general location or landmark (e.g. New York City, the White House). If the user does not provide one, ask for the relevant location\n2. If the user provides a general location or landmark, convert that into a lat-long coordinate. If required, browse the web to look up the lat-long point. \n3. Run the \"getPointData\" API action and retrieve back the gridId, gridX, and gridY parameters.\n4. Apply those variables as the office, gridX, and gridY variables in the \"getGridpointForecast\" API action to retrieve back a forecast\n5. Use that forecast to answer the user's question \n\n**Additional Notes**: \n- Assume the user uses US weather units (e.g. Farenheit) unless otherwise specified\n- If the user says \"Let's get started\" or \"What do I do?\", explain the purpose of this Custom GPT\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: NWS Weather API\n  description: Access to weather data including forecasts, alerts, and observations.\n  version: 1.0.0\nservers:\n  - url: https://api.weather.gov\n    description: Main API Server\npaths:\n  /points/{latitude},{longitude}:\n    get:\n      operationId: getPointData\n      summary: Get forecast grid endpoints for a specific location\n      parameters:\n        - name: latitude\n          in: path\n          required: true\n          schema:\n            type: number\n            format: float\n          description: Latitude of the point\n        - name: longitude\n          in: path\n          required: true\n          schema:\n            type: number\n            format: float\n          description: Longitude of the point\n      responses:\n        '200':\n          description: Successfully retrieved grid endpoints\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  properties:\n                    type: object\n                    properties:\n                      forecast:\n                        type: string\n                        format: uri\n                      forecastHourly:\n                        type: string\n                        format: uri\n                      forecastGridData:\n                        type: string\n                        format: uri\n\n  /gridpoints/{office}/{gridX},{gridY}/forecast:\n    get:\n      operationId: getGridpointForecast\n      summary: Get forecast for a given grid point\n      parameters:\n        - name: office\n          in: path\n          required: true\n          schema:\n            type: string\n          description: Weather Forecast Office ID\n        - name: gridX\n          in: path\n          required: true\n          schema:\n            type: integer\n          description: X coordinate of the grid\n        - name: gridY\n          in: path\n          required: true\n          schema:\n            type: integer\n          description: Y coordinate of the grid\n      responses:\n        '200':\n          description: Successfully retrieved gridpoint forecast\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  properties:\n                    type: object\n                    properties:\n                      periods:\n                        type: array\n                        items:\n                          type: object\n                          properties:\n                            number:\n                              type: integer\n                            name:\n                              type: string\n                            startTime:\n                              type: string\n                              format: date-time\n                            endTime:\n                              type: string\n                              format: date-time\n                            temperature:\n                              type: integer\n                            temperatureUnit:\n                              type: string\n                            windSpeed:\n                              type: string\n                            windDirection:\n                              type: string\n                            icon:\n                              type: string\n                              format: uri\n                            shortForecast:\n                              type: string\n                            detailedForecast:\n                              type: string\n```\n\n### FAQ & Troubleshooting\n\n*Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look.*"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 4141a3c3-df36-4e88-b6bf-01912f1da6a8
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"4141a3c3-df36-4e88-b6bf-01912f1da6a8\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"eebeb460-b651-40e8-a1e6-717d74bc90ab\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f84f3c05cd5b0eb2ecfc74a1c716eaff44d9149ef0bd403513917be8c0838d5b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3510, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "# GPT Action Library: Jira\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Buliding a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to Jira, Atlassian's tool for project and ticket management. This action assumes a user\u2019s context and allows them to read and write to issues in a given project.\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to Jira Cloud\n\n**Example Use Cases**: \n- A user can load up recent issues for a particular project and use ChatGPT to provide solutions\n- A user can create and alter issues and sub-tasks and assign to specific users by instructing ChatGPT\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://<YOUR_SUBDOMAIN>.atlassian.net/jira\n- Application API Documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/\n- Application OAuth 2.0 Documentation: https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Ensure you have the access and permissions to create an application in the [Atlassian Cloud Developer Console](https://developer.atlassian.com/console/myapps/)\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\n**Context**: you are specialized GPT designed to create and edit issues through API connections to Jira Cloud. This GPT can create, read, and edit project issues based on user instructions.\n\n**Instructions**:\n- When asked to perform a task, use the available actions via the api.atlassian.com API.\n- When asked to create an issue, use the user's input to synthesize a summary and description and file the issue in JIRA.\n- When asked to create a subtask, assume the project key and parent issue key of the currently discussed issue. Clarify with if this context is not available.\n- When asked to assign an issue or task to the user, first use jql to query the current user's profile and use this account as the assignee. \n- Ask for clarification when needed to ensure accuracy and completeness in fulfilling user requests.\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n*NOTE: Replace the placeholder <CLOUD_ID> in url with your cloud environment's unique ID. You can find this value by visiting https://<YOUR_SUBDOMAIN>.atlassian.net/_edge/tenant_info*\n\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Jira API\n  description: API for interacting with Jira issues and sub-tasks.\n  version: 1."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: eebeb460-b651-40e8-a1e6-717d74bc90ab
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"eebeb460-b651-40e8-a1e6-717d74bc90ab\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"4141a3c3-df36-4e88-b6bf-01912f1da6a8\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"4b4a4319f69b67641ab5646e8c641cca9c404a82334c65f4e5d570eabd1206ca\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ad2a30f4-2168-4b54-9ede-79e12782ec30\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"256c0fe0720a7e19929186ad76f084edeceea8b002d3dcc20350735ef1c26d02\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2106, \"end_char_idx\": 4516, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "```python\n**Context**: you are specialized GPT designed to create and edit issues through API connections to Jira Cloud. This GPT can create, read, and edit project issues based on user instructions.\n\n**Instructions**:\n- When asked to perform a task, use the available actions via the api.atlassian.com API.\n- When asked to create an issue, use the user's input to synthesize a summary and description and file the issue in JIRA.\n- When asked to create a subtask, assume the project key and parent issue key of the currently discussed issue. Clarify with if this context is not available.\n- When asked to assign an issue or task to the user, first use jql to query the current user's profile and use this account as the assignee. \n- Ask for clarification when needed to ensure accuracy and completeness in fulfilling user requests.\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n*NOTE: Replace the placeholder <CLOUD_ID> in url with your cloud environment's unique ID. You can find this value by visiting https://<YOUR_SUBDOMAIN>.atlassian.net/_edge/tenant_info*\n\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Jira API\n  description: API for interacting with Jira issues and sub-tasks.\n  version: 1.0.0\nservers:\n  - url: https://api.atlassian.com/ex/jira/<CLOUD_ID>/rest/api/3\n    description: Jira Cloud API\ncomponents:\n  securitySchemes:\n    OAuth2:\n      type: oauth2\n      flows:\n        authorizationCode:\n          authorizationUrl: https://auth.atlassian.com/authorize\n          tokenUrl: https://auth.atlassian.com/oauth/token\n          scopes:\n            read:jira-user: Read Jira user information\n            read:jira-work: Read Jira work data\n            write:jira-work: Write Jira work data\n  schemas:\n    Issue:\n      type: object\n      properties:\n        id:\n          type: string\n        key:\n          type: string\n        fields:\n          type: object\n          properties:\n            summary:\n              type: string\n            description:\n              type: string\n            issuetype:\n              type: object\n              properties:\n                name:\n                  type: string\npaths:\n  /search:\n    get:\n      operationId: getIssues\n      summary: Retrieve"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: ad2a30f4-2168-4b54-9ede-79e12782ec30
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"ad2a30f4-2168-4b54-9ede-79e12782ec30\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"eebeb460-b651-40e8-a1e6-717d74bc90ab\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"fde85fe1ad059051ca5d1f6c598d1da303523fa9cf8eeea39178a6e1e79074bd\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"2489437f-0c4e-4132-949f-c9c8ebf03004\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e4bac58a24076e64abf75044742ab4426b1ea66aadd4621edfe5240dfe6d530f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3763, \"end_char_idx\": 5176, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "atlassian.com/authorize\n          tokenUrl: https://auth.atlassian.com/oauth/token\n          scopes:\n            read:jira-user: Read Jira user information\n            read:jira-work: Read Jira work data\n            write:jira-work: Write Jira work data\n  schemas:\n    Issue:\n      type: object\n      properties:\n        id:\n          type: string\n        key:\n          type: string\n        fields:\n          type: object\n          properties:\n            summary:\n              type: string\n            description:\n              type: string\n            issuetype:\n              type: object\n              properties:\n                name:\n                  type: string\npaths:\n  /search:\n    get:\n      operationId: getIssues\n      summary: Retrieve a list of issues\n      parameters:\n        - name: jql\n          in: query\n          required: false\n          schema:\n            type: string\n        - name: startAt\n          in: query\n          required: false\n          schema:\n            type: integer\n        - name: maxResults\n          in: query\n          required: false\n          schema:\n            type: integer\n      responses:\n        '200':\n          description: A list of issues\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  issues:\n                    type: array\n                    items:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 2489437f-0c4e-4132-949f-c9c8ebf03004
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"2489437f-0c4e-4132-949f-c9c8ebf03004\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ad2a30f4-2168-4b54-9ede-79e12782ec30\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"419f15a993ecb3eb223e662594145c83c5cb224e3f06019b2d5fe2051ffaaeb0\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"85b2a819-a066-4589-bfbf-8669c992375f\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"151871c3b9401bc6ec8a47576cba59004d3d5ffaa9e0e093091c5bebea8b4d9c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4499, \"end_char_idx\": 5793, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "summary: Retrieve a list of issues\n      parameters:\n        - name: jql\n          in: query\n          required: false\n          schema:\n            type: string\n        - name: startAt\n          in: query\n          required: false\n          schema:\n            type: integer\n        - name: maxResults\n          in: query\n          required: false\n          schema:\n            type: integer\n      responses:\n        '200':\n          description: A list of issues\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  issues:\n                    type: array\n                    items:\n                      $ref: '#/components/schemas/Issue'\n  /issue:\n    post:\n      operationId: createIssue\n      summary: Create a new issue\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                fields:\n                  type: object\n                  properties:\n                    project:\n                      type: object\n                      properties:\n                        key:\n                          type: string\n                    summary:\n                      type: string"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 85b2a819-a066-4589-bfbf-8669c992375f
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"85b2a819-a066-4589-bfbf-8669c992375f\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"2489437f-0c4e-4132-949f-c9c8ebf03004\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"d7fa3772806cf28c8b3d81edad6b9795f9650f3da0df3a1ee22f0bb969850b0c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d7046a92-7bbf-4d71-8d6f-91468b93c1c6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"313ded860fb0dcf4f66f2a3aa772a2ff59d59fe6f11032202f48b712ca3ca999\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5170, \"end_char_idx\": 6471, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "items:\n                      $ref: '#/components/schemas/Issue'\n  /issue:\n    post:\n      operationId: createIssue\n      summary: Create a new issue\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                fields:\n                  type: object\n                  properties:\n                    project:\n                      type: object\n                      properties:\n                        key:\n                          type: string\n                    summary:\n                      type: string\n                    description:\n                      type: string\n                    issuetype:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n      responses:\n        '201':\n          description: Issue created successfully\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Issue'\n  /issue/{issueIdOrKey}:\n    get:\n      operationId: getIssue\n      summary: Retrieve a specific issue\n      parameters:\n        - name: issueIdOrKey\n          in: path\n          required: true\n          schema:\n            type: string"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: d7046a92-7bbf-4d71-8d6f-91468b93c1c6
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"d7046a92-7bbf-4d71-8d6f-91468b93c1c6\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"85b2a819-a066-4589-bfbf-8669c992375f\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"de6b196775d26711f9a6ef8345a9f3255cffd1bb080917fd727a8f65416e25ca\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b38811a8-2169-4c48-8149-e11438d0c677\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"360b6039faa8b4a030aa991a1a8229258f24978599a6837ef4d7ca7a403f66aa\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5781, \"end_char_idx\": 7150, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "type: string\n                    description:\n                      type: string\n                    issuetype:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n      responses:\n        '201':\n          description: Issue created successfully\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Issue'\n  /issue/{issueIdOrKey}:\n    get:\n      operationId: getIssue\n      summary: Retrieve a specific issue\n      parameters:\n        - name: issueIdOrKey\n          in: path\n          required: true\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Issue details\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Issue'\n    put:\n      operationId: updateIssue\n      summary: Update an existing issue\n      parameters:\n        - name: issueIdOrKey\n          in: path\n          required: true\n          schema:\n            type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                fields:\n                  type: object\n                  properties:\n                    summary:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: b38811a8-2169-4c48-8149-e11438d0c677
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"b38811a8-2169-4c48-8149-e11438d0c677\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d7046a92-7bbf-4d71-8d6f-91468b93c1c6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3fbdaf24d0c7296a67cec2f1c3ae355d6579faeb6b9e84f1166e7d2e06425157\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"28df3f67-f9e1-4f14-9213-942f675051c5\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"bbbcb1dfc0d624c3bff8350d0d97d8183c07cd4d0f1137027058a8ed68269962\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6414, \"end_char_idx\": 7787, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "required: true\n          schema:\n            type: string\n      responses:\n        '200':\n          description: Issue details\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Issue'\n    put:\n      operationId: updateIssue\n      summary: Update an existing issue\n      parameters:\n        - name: issueIdOrKey\n          in: path\n          required: true\n          schema:\n            type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                fields:\n                  type: object\n                  properties:\n                    summary:\n                      type: string\n                    description:\n                      type: string\n                    issuetype:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n      responses:\n        '204':\n          description: Issue updated successfully\n  /issue:\n    post:\n      operationId: createSubTask\n      summary: Create a sub-task for an issue\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                fields:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 28df3f67-f9e1-4f14-9213-942f675051c5
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"28df3f67-f9e1-4f14-9213-942f675051c5\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"b38811a8-2169-4c48-8149-e11438d0c677\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"afeb195c51aa401838b34d21b0ec0dda188958b634f7df848e63a8902cd19f61\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b5294266-fc02-4904-af7a-97174cf5e14a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ff12320ceaedadbb5ff405402bc7184654589653f8b1daf2a9daf65158a97b1c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7110, \"end_char_idx\": 8311, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "properties:\n                    summary:\n                      type: string\n                    description:\n                      type: string\n                    issuetype:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n      responses:\n        '204':\n          description: Issue updated successfully\n  /issue:\n    post:\n      operationId: createSubTask\n      summary: Create a sub-task for an issue\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                fields:\n                  type: object\n                  properties:\n                    project:\n                      type: object\n                      properties:\n                        key:\n                          type: string\n                    parent:\n                      type: object\n                      properties:\n                        key:\n                          type: string\n                    summary:\n                      type: string\n                    description:\n                      type: string"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: b5294266-fc02-4904-af7a-97174cf5e14a
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"b5294266-fc02-4904-af7a-97174cf5e14a\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"28df3f67-f9e1-4f14-9213-942f675051c5\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"514f25a6cae118ecbad764b155c358a5d69c916ccdde45eefd5b048461276b86\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"10a5cc20-0367-4b88-be17-e0ad73be57fb\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f2bcbb40b33250b1dd86b432d4440c54ca922f1030f820ee86e61a19ba06fd77\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7780, \"end_char_idx\": 9033, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "fields:\n                  type: object\n                  properties:\n                    project:\n                      type: object\n                      properties:\n                        key:\n                          type: string\n                    parent:\n                      type: object\n                      properties:\n                        key:\n                          type: string\n                    summary:\n                      type: string\n                    description:\n                      type: string\n                    issuetype:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n      responses:\n        '201':\n          description: Sub-task created successfully\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Issue'\nsecurity:\n  - OAuth2:\n      - read:jira-user\n      - read:jira-work\n      - write:jira-work\n\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with Jira. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 10a5cc20-0367-4b88-be17-e0ad73be57fb
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"10a5cc20-0367-4b88-be17-e0ad73be57fb\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"b5294266-fc02-4904-af7a-97174cf5e14a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"4212136c18c0c3a87f190838d69a1c893164eb4e0dd43af829714306b5677288\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0b4047f4-ca22-4baf-b7ff-ddc4d520f987\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"3bc447c248aaa14da458bb762575d62ece265c542216364068fb39c67840592d\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8200, \"end_char_idx\": 10739, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "summary:\n                      type: string\n                    description:\n                      type: string\n                    issuetype:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n      responses:\n        '201':\n          description: Sub-task created successfully\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Issue'\nsecurity:\n  - OAuth2:\n      - read:jira-user\n      - read:jira-work\n      - write:jira-work\n\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with Jira. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n### Jira Steps\n\n1. <b>Create an Application</b>: The first step is to create a new application in Jira for the integration with ChatGPT. This can be done by visiting the [Atlassian Developer Console](https://developer.atlassian.com/console/myapps/), Clicking **Create** and selecting **OAuth 2.0 Integration**. \n\n![gptactions_jira_devconsole.png](../../../images/gptactions_jira_devconsole.png)\n\nFrom here, simply enter the name of your integration and click **Create**.\n\n![gptactions_jira_newapplication.png](../../../images/gptactions_jira_newapplication.png)\n\n2. <b>Define Permissions</b>: Next we need to provide the required permissions to our application. Within the new application, open the **Permissions** menu from the sidebar, locate **Jira API** and click **Add** and then **Configure**.\n\n![gptactions_jira_permissions.png](../../../images/gptactions_jira_permissions.png)\n\nRequired permissions will vary depending on the intended functionality of the GPT. In this scenario we wish to read and write to Jira issues, so select the following scopes under **Jira platform REST API** by clicking **Edit Scopes**:\n\n- read:jira-work\n- write:jira-work\n- read:jira-user\n\nOnce selected, click **Save**\n\n![gptactions_jira_scopes.png](../../../images/gptactions_jira_scopes.png)\n\n3. <b>Configure Placeholder Callback URL</b>: In order to complete the following step and obtain a **Client ID** and **Secret** for enabling secure authentication between ChatGPT and Jira, we first need to add a placeholder callback URL. We can achieve this by clicking on **Authorization** in the sidebar, and **Configure** next to **OAuth 2.0 (3LO)**. From here simply enter a placeholder URL and click **Save Changes**."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 0b4047f4-ca22-4baf-b7ff-ddc4d520f987
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"0b4047f4-ca22-4baf-b7ff-ddc4d520f987\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"10a5cc20-0367-4b88-be17-e0ad73be57fb\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"03850dabfbba5f334c856ee7c1e1a1f007143b822520b493620a623ed6fb0dc5\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b1b921e1-8ea6-43eb-9066-50e3c898faa5\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f6b11ece92e760162bbb7b0af8509bc920f2de17db38c3bc6b8412e16bad8b2f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 9036, \"end_char_idx\": 12243, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "### Jira Steps\n\n1. <b>Create an Application</b>: The first step is to create a new application in Jira for the integration with ChatGPT. This can be done by visiting the [Atlassian Developer Console](https://developer.atlassian.com/console/myapps/), Clicking **Create** and selecting **OAuth 2.0 Integration**. \n\n![gptactions_jira_devconsole.png](../../../images/gptactions_jira_devconsole.png)\n\nFrom here, simply enter the name of your integration and click **Create**.\n\n![gptactions_jira_newapplication.png](../../../images/gptactions_jira_newapplication.png)\n\n2. <b>Define Permissions</b>: Next we need to provide the required permissions to our application. Within the new application, open the **Permissions** menu from the sidebar, locate **Jira API** and click **Add** and then **Configure**.\n\n![gptactions_jira_permissions.png](../../../images/gptactions_jira_permissions.png)\n\nRequired permissions will vary depending on the intended functionality of the GPT. In this scenario we wish to read and write to Jira issues, so select the following scopes under **Jira platform REST API** by clicking **Edit Scopes**:\n\n- read:jira-work\n- write:jira-work\n- read:jira-user\n\nOnce selected, click **Save**\n\n![gptactions_jira_scopes.png](../../../images/gptactions_jira_scopes.png)\n\n3. <b>Configure Placeholder Callback URL</b>: In order to complete the following step and obtain a **Client ID** and **Secret** for enabling secure authentication between ChatGPT and Jira, we first need to add a placeholder callback URL. We can achieve this by clicking on **Authorization** in the sidebar, and **Configure** next to **OAuth 2.0 (3LO)**. From here simply enter a placeholder URL and click **Save Changes**.\n\n\n![gptactions_jira_placeholder.png](../../../images/gptactions_jira_placeholder.png)\n\n4. <b>Application Client ID/Secret</b>: The next step is to locate the **Client ID** and **Secret** for enabling secure authentication between ChatGPT and Jira. We can find these values by clicking on **Settings** in the sidebar and scrolling down to **Authentication Details**. \n\n      Keep this page open as we will require these values in the next stage of configuration!\n\n![gptactions_jira_clientsecret.png](../../../images/gptactions_jira_clientsecret.png)\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: The **Client ID** from **Step 3** of Jira Configuration\n- **Client Secret**: The **Secret** from **Step 3** of Jira Configuration\n- **Authorization URL**: https://auth.atlassian.com/authorize\n- **Token URL**: https://auth.atlassian.com/oauth/token\n- **Scope**: read:jira-work write:jira-work read:jira-user \n- **Token Exchange Method**: Default (POST Request)\n\n### Post-Action Steps\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n\n![gptactions_jira_redirect.png](../../../images/gptactions_jira_redirect.png)\n\n- In your application in the Atlassian Developer Console, navigate to the **Authorization** sidebar tab, next to **OAuth 2.0 (3L0)** click **Configure**, and add your callback URL under **Callback URL**"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: b1b921e1-8ea6-43eb-9066-50e3c898faa5
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb", "title": "GPT Action Library: Jira", "tokens": 2617, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"b1b921e1-8ea6-43eb-9066-50e3c898faa5\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ea4bb75d-db87-4252-9edf-06d296bd3f5f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"17b1280f8d851e39ac18875d463f8fe77bb331ddefac02003a979c59c804e134\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"0b4047f4-ca22-4baf-b7ff-ddc4d520f987\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_jira.ipynb\", \"title\": \"GPT Action Library: Jira\", \"tokens\": 2617, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"797ad9cb112018cff61d35ce2a6d27eca60cb7389e56e96763c0651700894335\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10742, \"end_char_idx\": 12699, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "ref_doc_id": "ea4bb75d-db87-4252-9edf-06d296bd3f5f", "chroma:document": "![gptactions_jira_placeholder.png](../../../images/gptactions_jira_placeholder.png)\n\n4. <b>Application Client ID/Secret</b>: The next step is to locate the **Client ID** and **Secret** for enabling secure authentication between ChatGPT and Jira. We can find these values by clicking on **Settings** in the sidebar and scrolling down to **Authentication Details**. \n\n      Keep this page open as we will require these values in the next stage of configuration!\n\n![gptactions_jira_clientsecret.png](../../../images/gptactions_jira_clientsecret.png)\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: The **Client ID** from **Step 3** of Jira Configuration\n- **Client Secret**: The **Secret** from **Step 3** of Jira Configuration\n- **Authorization URL**: https://auth.atlassian.com/authorize\n- **Token URL**: https://auth.atlassian.com/oauth/token\n- **Scope**: read:jira-work write:jira-work read:jira-user \n- **Token Exchange Method**: Default (POST Request)\n\n### Post-Action Steps\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n\n![gptactions_jira_redirect.png](../../../images/gptactions_jira_redirect.png)\n\n- In your application in the Atlassian Developer Console, navigate to the **Authorization** sidebar tab, next to **OAuth 2.0 (3L0)** click **Configure**, and add your callback URL under **Callback URL**\n\n\n![gptactions_jira_callback.png](../../../images/gptactions_jira_callback.png)\n\n### FAQ & Troubleshooting\n\n- **Callback URL Error**: If you get a callback URL error in ChatGPT, double check the Callback URL value as it can occasionally change depending on any alterations made to the authentication\n\n\n*Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look.*"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 219f445c-69b2-4e3e-8e32-62bf96601748
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb", "title": "## Introduction", "tokens": 2113, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"219f445c-69b2-4e3e-8e32-62bf96601748\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"34f29484-84de-45e3-8f09-8612bc5ade9a\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7615bccb53b0b8b53d08bf4d35b23e642825f51df7c3465919e831b4539b4cca\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"287a87fe-d61b-4f3c-b241-4e4c6d7e39b7\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6d727e0097d3179e46edfe001d231c68c7e28db448924f6912ee0cf5ddf62a3a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3592, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "ref_doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "chroma:document": "## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions/introduction)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Buliding a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to Salesforce, specifically, Salesforce Service Cloud. This schema detailed in this Action allows the user to pull case data and update cases directly from ChatGPT. The setup process to create Actions for other Salesforce Cloud solutions uses the same Connected App and authentication setup, but will require a different API schema.\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to Salesforce\n\n**Example Use Cases**: \n- Reduce average response time to customers\n- Reduce time to troubleshoot cases or issues\n- Ensure more consistent brand voice in reponse to customers when combined with knowledge and instructions in the GPT\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- [Create Lightning Apps in Salesforce](https://help.salesforce.com/s/articleView?id=sf.apps_lightning_create.htm&type=5)\n- [OAuth Tokens and Scopes](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_tokens_scopes.htm&type=5)\n- [Salesforce API Docs](https://developer.salesforce.com/docs/apis)\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Ensure you have permissions to create an App in Salesforce\n\n## ChatGPT Steps\n\n### Custom GPT Instructions\n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n**Context**: Your purpose is to pull information from Service Cloud, and push updates to cases. A user is going to ask you a question and ask you to make updates.\n\n**Instructions**:\n1. When a user asks you to help them solve a case in Service Cloud, ask for the case number and pull the details for the case into the conversation using the getCaseDetailsFromNumber action.\n2. If the user asks you to update the case details, use the action updateCaseStatus.\n\n**Example**: \nUser: Help me solve case 00001104 in Service Cloud.\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Salesforce Service Cloud Case Update API\n  description: API for updating the status of Service Cloud tickets (cases) in Salesforce.\n  version: 1.0.3\nservers:\n  - url: https://your_instance.my.salesforce.com\n    description: Base URL for your Salesforce instance (replace 'your_instance' with your actual Salesforce domain)\npaths:\n  /services/data/v60.0/sobjects/Case/{CaseId}:\n    patch:\n      operationId: updateCaseStatus\n      summary: Updates the status of a Service Cloud case\n      description: Updates the status of a Service Cloud ticket based on the case ID number."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 287a87fe-d61b-4f3c-b241-4e4c6d7e39b7
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb", "title": "## Introduction", "tokens": 2113, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"287a87fe-d61b-4f3c-b241-4e4c6d7e39b7\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"34f29484-84de-45e3-8f09-8612bc5ade9a\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7615bccb53b0b8b53d08bf4d35b23e642825f51df7c3465919e831b4539b4cca\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"219f445c-69b2-4e3e-8e32-62bf96601748\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"04fc5f43e31bf7e2347a926dfe542cf71a89b527862dc3df3e591e82a2d1cdc0\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"369c1721-7781-4052-a43c-3c1407e18966\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"fa11e092abecc66a7fbe08fb2c40f745e67f11002fceb4e33a2d0be6ca358195\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2978, \"end_char_idx\": 6949, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "ref_doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "chroma:document": "```python\nopenapi: 3.1.0\ninfo:\n  title: Salesforce Service Cloud Case Update API\n  description: API for updating the status of Service Cloud tickets (cases) in Salesforce.\n  version: 1.0.3\nservers:\n  - url: https://your_instance.my.salesforce.com\n    description: Base URL for your Salesforce instance (replace 'your_instance' with your actual Salesforce domain)\npaths:\n  /services/data/v60.0/sobjects/Case/{CaseId}:\n    patch:\n      operationId: updateCaseStatus\n      summary: Updates the status of a Service Cloud case\n      description: Updates the status of a Service Cloud ticket based on the case ID number.\n      parameters:\n        - name: CaseId\n          in: path\n          required: true\n          description: The ID of the case to update.\n          schema:\n            type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                Status:\n                  type: string\n                  description: The new status of the case.\n      responses:\n        '204':\n          description: Successfully updated the case status\n        '400':\n          description: Bad request - invalid input or case ID not found\n        '401':\n          description: Unauthorized - authentication required\n        '404':\n          description: Not Found - case ID does not exist\n    delete:\n      operationId: deleteCase\n      summary: Deletes a Service Cloud case\n      description: Deletes a Service Cloud ticket based on the case ID number.\n      parameters:\n        - name: CaseId\n          in: path\n          required: true\n          description: The ID of the case to delete.\n          schema:\n            type: string\n      responses:\n        '204':\n          description: Successfully deleted the case\n        '400':\n          description: Bad request - invalid case ID\n        '401':\n          description: Unauthorized - authentication required\n        '404':\n          description: Not Found - case ID does not exist\n  /services/data/v60.0/query:\n    get:\n      operationId: getCaseDetailsFromNumber\n      summary: Retrieves case details using a case number\n      description: Retrieves the details of a Service Cloud case associated with a given case number.\n      parameters:\n        - name: q\n          in: query\n          required: true\n          description: SOQL query string to find the Case details based on Case Number.\n          schema:\n            type: string\n            example: \"SELECT Id, CaseNumber, Status, Subject, Description FROM Case WHERE CaseNumber = '123456'\"\n      responses:\n        '200':\n          description: Successfully retrieved the case details\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  totalSize:\n                    type: integer\n                  done:\n                    type: boolean\n                  records:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        Id:\n                          type: string\n                        CaseNumber:\n                          type: string\n                        Status:\n                          type: string\n                        Subject:\n                          type: string\n                        Description:\n                          type: string\n        '400':\n          description: Bad request - invalid query\n        '401':\n          description: Unauthorized - authentication required\n        '404':\n          description: Not Found - case number does not exist\n\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 369c1721-7781-4052-a43c-3c1407e18966
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb", "title": "## Introduction", "tokens": 2113, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"369c1721-7781-4052-a43c-3c1407e18966\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"34f29484-84de-45e3-8f09-8612bc5ade9a\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7615bccb53b0b8b53d08bf4d35b23e642825f51df7c3465919e831b4539b4cca\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"287a87fe-d61b-4f3c-b241-4e4c6d7e39b7\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ecbbd4248b0aa4625933b1fbd85f656e04fca2a75e896cca6ba9f749f7d17673\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"01982adc-018c-4f39-8b27-548646c248d5\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"0c72ef83736e2424a8eaa8246e4a5c0698cf738d2d57c8a0562720f4def819f4\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4690, \"end_char_idx\": 8279, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "ref_doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "chroma:document": "schema:\n            type: string\n      responses:\n        '204':\n          description: Successfully deleted the case\n        '400':\n          description: Bad request - invalid case ID\n        '401':\n          description: Unauthorized - authentication required\n        '404':\n          description: Not Found - case ID does not exist\n  /services/data/v60.0/query:\n    get:\n      operationId: getCaseDetailsFromNumber\n      summary: Retrieves case details using a case number\n      description: Retrieves the details of a Service Cloud case associated with a given case number.\n      parameters:\n        - name: q\n          in: query\n          required: true\n          description: SOQL query string to find the Case details based on Case Number.\n          schema:\n            type: string\n            example: \"SELECT Id, CaseNumber, Status, Subject, Description FROM Case WHERE CaseNumber = '123456'\"\n      responses:\n        '200':\n          description: Successfully retrieved the case details\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  totalSize:\n                    type: integer\n                  done:\n                    type: boolean\n                  records:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        Id:\n                          type: string\n                        CaseNumber:\n                          type: string\n                        Status:\n                          type: string\n                        Subject:\n                          type: string\n                        Description:\n                          type: string\n        '400':\n          description: Bad request - invalid query\n        '401':\n          description: Unauthorized - authentication required\n        '404':\n          description: Not Found - case number does not exist\n\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n### Pre-Action Steps\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n1. Navigate to Salesforce Setup\n\n![gptactions_salesforce.png](../../../images/gpt_actions_salesforce_setup.png)\n\n2. Search for \u201cApp Manager\u201d\n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_manager.png)\n\n3. Click \u201cNew Connected App\u201d\n4. Enter a Connected App Name\n5. Enter contact email (your email)\n6. Check the box to enable OAuth settings\n7. Insert a callback URL (use a placeholder like https://chat.openai.com/aip//oauth/callback for now, you\u2019ll update this later when you create the Action in ChatGPT) \n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_oauth2.png)\n\n8. Select \u201cSelected OAuth Scopes\u201d and grant the appropriate permissions. Scope these based on your internal security policies. \n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_scope.png)\n\n9. Ensure the following boxes are checked:\n- Enable Client Credentials Flow\n- Enable Authorization Code and Credentials FLow\n- Enable Token Exchange Flow\n10. Ensure the following box is unchecked: \n- Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 01982adc-018c-4f39-8b27-548646c248d5
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb", "title": "## Introduction", "tokens": 2113, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"01982adc-018c-4f39-8b27-548646c248d5\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"34f29484-84de-45e3-8f09-8612bc5ade9a\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7615bccb53b0b8b53d08bf4d35b23e642825f51df7c3465919e831b4539b4cca\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"369c1721-7781-4052-a43c-3c1407e18966\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"211c918448ecf8066509d5e0b257576781a20ce0e32d38387943c656b93fbaa0\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"e06dadbd-b720-43b0-823e-22d68af007aa\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"8d9f81bf49d278243ffde964c91b080c4f4505e6b675d2321daca8e46ebf0c2a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6797, \"end_char_idx\": 9697, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "ref_doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "chroma:document": "Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n### Pre-Action Steps\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n1. Navigate to Salesforce Setup\n\n![gptactions_salesforce.png](../../../images/gpt_actions_salesforce_setup.png)\n\n2. Search for \u201cApp Manager\u201d\n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_manager.png)\n\n3. Click \u201cNew Connected App\u201d\n4. Enter a Connected App Name\n5. Enter contact email (your email)\n6. Check the box to enable OAuth settings\n7. Insert a callback URL (use a placeholder like https://chat.openai.com/aip//oauth/callback for now, you\u2019ll update this later when you create the Action in ChatGPT) \n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_oauth2.png)\n\n8. Select \u201cSelected OAuth Scopes\u201d and grant the appropriate permissions. Scope these based on your internal security policies. \n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_scope.png)\n\n9. Ensure the following boxes are checked:\n- Enable Client Credentials Flow\n- Enable Authorization Code and Credentials FLow\n- Enable Token Exchange Flow\n10. Ensure the following box is unchecked: \n- Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows\n\n\n![gptactions_salesforce.png](../../../images/gpt_actions_salesforce_settings_condensed.png) \n\n11. Save your New Connected App\n12. Under \u201cConsumer Key and Secret\u201d click \u201cManage Consumer Details\u201d. Verify your access using the code emailed to your account, and then copy the key and secret. \n- Salesforce Consumer Key = ChatGPT Client ID\n- Salesforce Consumer Secret = ChatGPT Client Secret\n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_credentials.png)\n\n13. Return to App page\n14. Click \u201cManage\u201d \n15. Click \u201cEdit Policies\u201d\n16. Under OAuth Policies, check the \u201cEnable Token Exchange Flow\u201d box\n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_token.png)\n\n17. Click save!\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: use Client ID from steps above \n- **Client Secret**: use Client Secret from steps above\n- **Authorization URL**: https://[inserturlhere].my.salesforce.com/services/oauth2/authorize\n- **Token URL**: https://[inserturlhere].my.salesforce.com/services/oauth2/token \n- **Scope**: full\n- **Token**: Default (POST)\n\n### Post-Action Steps\n\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n- Navigate back to your Connected App in Salesforce, and add your callback URL."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: e06dadbd-b720-43b0-823e-22d68af007aa
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb", "title": "## Introduction", "tokens": 2113, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"e06dadbd-b720-43b0-823e-22d68af007aa\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"34f29484-84de-45e3-8f09-8612bc5ade9a\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7615bccb53b0b8b53d08bf4d35b23e642825f51df7c3465919e831b4539b4cca\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"01982adc-018c-4f39-8b27-548646c248d5\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_salesforce.ipynb\", \"title\": \"## Introduction\", \"tokens\": 2113, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"973698ef04e8e8731954fcf37e5faf1fadd9d2ba1a4dc82608331fbcfff286ff\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8282, \"end_char_idx\": 10226, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "ref_doc_id": "34f29484-84de-45e3-8f09-8612bc5ade9a", "chroma:document": "![gptactions_salesforce.png](../../../images/gpt_actions_salesforce_settings_condensed.png) \n\n11. Save your New Connected App\n12. Under \u201cConsumer Key and Secret\u201d click \u201cManage Consumer Details\u201d. Verify your access using the code emailed to your account, and then copy the key and secret. \n- Salesforce Consumer Key = ChatGPT Client ID\n- Salesforce Consumer Secret = ChatGPT Client Secret\n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_credentials.png)\n\n13. Return to App page\n14. Click \u201cManage\u201d \n15. Click \u201cEdit Policies\u201d\n16. Under OAuth Policies, check the \u201cEnable Token Exchange Flow\u201d box\n\n\n![gptactions_salesforce.png](../../../images//gpt_actions_salesforce_token.png)\n\n17. Click save!\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: use Client ID from steps above \n- **Client Secret**: use Client Secret from steps above\n- **Authorization URL**: https://[inserturlhere].my.salesforce.com/services/oauth2/authorize\n- **Token URL**: https://[inserturlhere].my.salesforce.com/services/oauth2/token \n- **Scope**: full\n- **Token**: Default (POST)\n\n### Post-Action Steps\n\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n- Navigate back to your Connected App in Salesforce, and add your callback URL.\n\n\n### FAQ & Troubleshooting\n\n- *Callback URL Error:*  If you get a callback URL error in ChatGPT, pay close attention to the screenshot above. You need to add the callback URL directly into Salesforce for the action to authenticate correctly\n- *Internal Server Error:* Ensure all the correct boxes are checked and/or unchecked in the OAuth settings for your connected app. \n\n*Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look.*"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 76511996-64d8-4080-86c4-75d2086c1cc2
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb", "title": "GPT Action Library: BigQuery", "tokens": 1723, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"76511996-64d8-4080-86c4-75d2086c1cc2\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"8fd54d6f-617f-41c3-a05c-49862cc6ba17\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ed45a0f1647c97f111c8618c6a0c4fce5713e6ba2371ff0c2df00c234fd0e339\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"77bf98fc-6571-4be3-b050-717f702024af\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"57911b57e3a2a95bd3e2d1746922a69f772e67627146884ac697912cd7aaac92\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2280, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "ref_doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "chroma:document": "# GPT Action Library: BigQuery\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to **Google BigQuery**, Google Cloud's Analytical Data Warehouse. This Action takes a user\u2019s question, scans the relevant tables to gather the data schema, then writes a SQL query to answer the user\u2019s question. \n\nNote: these instructions return back a functioning SQL statement, rather than the result itself. Currently middleware is required to return back a CSV file \u2013 we\u2019ll be posting instructions on an example of that soon\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to BigQuery's DWH. \n\n**Example Use Cases**: \n- Data scientists can connect to tables and run data analyses using ChatGPT's Data Analysis\n- Citizen data users can ask basic questions of their transactional data\n- Users gain more visibility into their data & potential anomalies\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://cloud.google.com/bigquery \n- Application API Documentation: https://cloud.google.com/bigquery/docs/reference/rest \n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Set up a GCP project \n- Set up a BQ dataset in that GCP project\n- Ensure that the user authenticating into BigQuery via ChatGPT has access to that BQ dataset \n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 77bf98fc-6571-4be3-b050-717f702024af
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb", "title": "GPT Action Library: BigQuery", "tokens": 1723, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"77bf98fc-6571-4be3-b050-717f702024af\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"8fd54d6f-617f-41c3-a05c-49862cc6ba17\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ed45a0f1647c97f111c8618c6a0c4fce5713e6ba2371ff0c2df00c234fd0e339\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"76511996-64d8-4080-86c4-75d2086c1cc2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"e0db81bb050afe9b25289b1eff0298355c09105e8a8c00ac84271500b357ca1e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5fc2231b-f944-43de-8493-86923cd03361\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"803397d4bd6a825097902ea1d58578550f1f72b850da83566193f2bc56907def\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2283, \"end_char_idx\": 6323, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "ref_doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "chroma:document": "```python\n**Context**: You are an expert at writing BigQuery SQL queries. A user is going to ask you a question. \n\n**Instructions**:\n1. No matter the user's question, start by running `runQuery` operation using this query: \"SELECT column_name, table_name, data_type, description FROM `{project}.{dataset}.INFORMATION_SCHEMA.COLUMN_FIELD_PATHS`\" \n-- Assume project = \"<insert your default project here>\", dataset = \"<insert your default dataset here>\", unless the user provides different values \n-- Remember to include useLegacySql:false in the json output\n2. Convert the user's question into a SQL statement that leverages the step above and run the `runQuery` operation on that SQL statement to confirm the query works. Add a limit of 100 rows\n3. Now remove the limit of 100 rows and return back the query for the user to see\n\n**Additional Notes**: If the user says \"Let's get started\", explain that the user can provide a project or dataset, along with a question they want answered. If the user has no ideas, suggest that we have a sample flights dataset they can query - ask if they want you to query that\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: BigQuery API\n  description: API for querying a BigQuery table.\n  version: 1.0.0\nservers:\n  - url: https://bigquery.googleapis.com/bigquery/v2\n    description: Google BigQuery API server\npaths:\n  /projects/{projectId}/queries:\n    post:\n      operationId: runQuery\n      summary: Executes a query on a specified BigQuery table.\n      description: Submits a query to BigQuery and returns the results.\n      x-openai-isConsequential: false\n      parameters:\n        - name: projectId\n          in: path\n          required: true\n          description: The ID of the Google Cloud project.\n          schema:\n            type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                query:\n                  type: string\n                  description: The SQL query string.\n                useLegacySql:\n                  type: boolean\n                  description: Whether to use legacy SQL.\n                  default: false\n      responses:\n        '200':\n          description: Successful query execution.\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  kind:\n                    type: string\n                    example: \"bigquery#queryResponse\"\n                  schema:\n                    type: object\n                    description: The schema of the results.\n                  jobReference:\n                    type: object\n                    properties:\n                      projectId:\n                        type: string\n                      jobId:\n                        type: string\n                  rows:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        f:\n                          type: array\n                          items:\n                            type: object\n                            properties:\n                              v:\n                                type: string\n                  totalRows:\n                    type: string\n                    description: Total number of rows in the query result.\n                  pageToken:\n                    type: string\n                    description: Token for pagination of query results.\n        '400':\n          description: Bad request. The request was invalid.\n        '401':\n          description: Unauthorized. Authentication is required.\n        '403':\n          description: Forbidden. The request is not allowed."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 5fc2231b-f944-43de-8493-86923cd03361
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb", "title": "GPT Action Library: BigQuery", "tokens": 1723, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"5fc2231b-f944-43de-8493-86923cd03361\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"8fd54d6f-617f-41c3-a05c-49862cc6ba17\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ed45a0f1647c97f111c8618c6a0c4fce5713e6ba2371ff0c2df00c234fd0e339\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"77bf98fc-6571-4be3-b050-717f702024af\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"c3ebef95ab7e0416c54dd16432efedbb16b30019284e013fbbdc0ea85f5ad717\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"fe0e895f-9108-4436-8b70-b243f1515bcd\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b32152074618f769857856817faa2a03968f0050468e7d9bae585a11eb01e4a9\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4023, \"end_char_idx\": 7912, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "ref_doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "chroma:document": "description: Submits a query to BigQuery and returns the results.\n      x-openai-isConsequential: false\n      parameters:\n        - name: projectId\n          in: path\n          required: true\n          description: The ID of the Google Cloud project.\n          schema:\n            type: string\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                query:\n                  type: string\n                  description: The SQL query string.\n                useLegacySql:\n                  type: boolean\n                  description: Whether to use legacy SQL.\n                  default: false\n      responses:\n        '200':\n          description: Successful query execution.\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  kind:\n                    type: string\n                    example: \"bigquery#queryResponse\"\n                  schema:\n                    type: object\n                    description: The schema of the results.\n                  jobReference:\n                    type: object\n                    properties:\n                      projectId:\n                        type: string\n                      jobId:\n                        type: string\n                  rows:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        f:\n                          type: array\n                          items:\n                            type: object\n                            properties:\n                              v:\n                                type: string\n                  totalRows:\n                    type: string\n                    description: Total number of rows in the query result.\n                  pageToken:\n                    type: string\n                    description: Token for pagination of query results.\n        '400':\n          description: Bad request. The request was invalid.\n        '401':\n          description: Unauthorized. Authentication is required.\n        '403':\n          description: Forbidden. The request is not allowed.\n        '404':\n          description: Not found. The specified resource was not found.\n        '500':\n          description: Internal server error. An error occurred while processing the request.\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n### Pre-Action Steps\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n\n- Go to the Google Cloud Console\n- Navigate to API & Services > Credentials\n- Create new OAuth credentials (or use an existing one)\n- Locate your OAuth Client ID & Client Secret and store both values securely (see screenshot below)\n\n![gptactions_BigQuery_auth.png](../../../images/gptactions_BigQuery_auth.png)\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: use Client ID from steps above \n- **Client Secret**: use Client Secret from steps above\n- **Authorization URL**: https://accounts.google.com/o/oauth2/auth\n- **Token URL**: https://oauth2.googleapis.com/token \n- **Scope**: https://www.googleapis.com/auth/bigquery \n- **Token**: Default (POST)\n\n### Post-Action Steps\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n- In the \u201cAuthorized redirect URIs\u201d (see screenshot above), add your callback URL"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: fe0e895f-9108-4436-8b70-b243f1515bcd
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb", "title": "GPT Action Library: BigQuery", "tokens": 1723, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"fe0e895f-9108-4436-8b70-b243f1515bcd\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"8fd54d6f-617f-41c3-a05c-49862cc6ba17\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"ed45a0f1647c97f111c8618c6a0c4fce5713e6ba2371ff0c2df00c234fd0e339\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5fc2231b-f944-43de-8493-86923cd03361\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_bigquery.ipynb\", \"title\": \"GPT Action Library: BigQuery\", \"tokens\": 1723, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3e2e059eabacca52c6ffcc74b2a83f016ede016f0a5909573acec3ec9e774b62\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6099, \"end_char_idx\": 8589, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "ref_doc_id": "8fd54d6f-617f-41c3-a05c-49862cc6ba17", "chroma:document": "'400':\n          description: Bad request. The request was invalid.\n        '401':\n          description: Unauthorized. Authentication is required.\n        '403':\n          description: Forbidden. The request is not allowed.\n        '404':\n          description: Not found. The specified resource was not found.\n        '500':\n          description: Internal server error. An error occurred while processing the request.\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n### Pre-Action Steps\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n\n- Go to the Google Cloud Console\n- Navigate to API & Services > Credentials\n- Create new OAuth credentials (or use an existing one)\n- Locate your OAuth Client ID & Client Secret and store both values securely (see screenshot below)\n\n![gptactions_BigQuery_auth.png](../../../images/gptactions_BigQuery_auth.png)\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose **\"OAuth\"**. Enter in the information below. \n\n- **Client ID**: use Client ID from steps above \n- **Client Secret**: use Client Secret from steps above\n- **Authorization URL**: https://accounts.google.com/o/oauth2/auth\n- **Token URL**: https://oauth2.googleapis.com/token \n- **Scope**: https://www.googleapis.com/auth/bigquery \n- **Token**: Default (POST)\n\n### Post-Action Steps\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action. \n\n- Copy the callback URL from the GPT Action\n- In the \u201cAuthorized redirect URIs\u201d (see screenshot above), add your callback URL \n\n\n### FAQ & Troubleshooting\n\n- *Callback URL Error:* If you get a callback URL error in ChatGPT, pay close attention to the screenshot above. You need to add the callback URL directly into GCP for the action to authenticate correctly\n- *Schema calls the wrong project or dataset:* If ChatGPT calls the wrong project or dataset, consider updating your instructions to make it more explicit either (a) which project / dataset should be called or (b) to require the user provide those exact details before it runs the query\n\n*Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look.*"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 30d00c78-8f95-4406-82b5-8d3b9cc7f16a
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"30d00c78-8f95-4406-82b5-8d3b9cc7f16a\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d50c61a9-2ad6-4bb6-938c-3d80b5b9d59d\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"7bb958fe707b46f22189caef0ec89c6a3ab67e5ab5f03e57ad8fae234cef3724\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2929, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "# GPT Action Library: Sharepoint (Return as Document)\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis solution enables a GPT action to answer a user\u2019s question with the context of files the user can access in SharePoint or Office365, using Microsoft\u2019s Graph API [search capabilities](https://learn.microsoft.com/en-us/graph/api/resources/search-api-overview?view=graph-rest-1.0) and the ability to [retrieve files](https://learn.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0\\&tabs=http). It uses Azure Functions to process the Graph API response and convert it to a human readable format or structure it in a way ChatGPT understands. This code is meant to be directional, and you should modify it to your requirements.\n\nThis solution pre-processes the file within the Azure Function. The Azure Function returns text, instead of the base64 encoded file. Due to the pre-processing and the conversion to text, this solution is best used for large, unstructured documents, and for when you want to analyze more than the amount of files supported in the first solution (see documentation [here](https://platform.openai.com/docs/actions/sending-files)).\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to files in Sharpeoint\n\n**Example Use Cases**: \n- A user needs to look up which files relate to a certain topic\n- A user needs an answer to a critical question, buried deep in documents\n\n## Architecture / Example\n\n![](../../../images/solution_2.gif)\n\nThis solution uses a Node.js Azure Function to, based on the logged in user:\n\n1. Search for a relevant file that the user has access to, based on the user\u2019s initial question.\n\n2. For each file that is found, convert it to a consistent readable format and retrieve all the text.\n\n3. Use GPT 4o mini (gpt-4o-mini) to extract the relevant text from the files based on the initial user\u2019s question. Note the pricing of GPT 4o mini [here](https://openai.com/pricing#language-models) - since we are dealing with small token chunks, the cost of this step is nominal.\u00a0\u00a0\n\n4. Returns that data to ChatGPT. The GPT then uses that information to respond to the user's initial question.\n\nAs 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 4o mini.\n\n!"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: d50c61a9-2ad6-4bb6-938c-3d80b5b9d59d
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"d50c61a9-2ad6-4bb6-938c-3d80b5b9d59d\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"30d00c78-8f95-4406-82b5-8d3b9cc7f16a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"14c3794cead7ea6ec6630ada39d8b4b2b9e43d48cb0a2ecd6087f1f66f3d015b\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"069a8ab2-01f6-4554-9b2a-59bd98e68e95\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e58c907949189810b92519fe61b8a36ebadba4594ca9c1df30131bd4c6fa42b9\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 1194, \"end_char_idx\": 4587, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "This solution pre-processes the file within the Azure Function. The Azure Function returns text, instead of the base64 encoded file. Due to the pre-processing and the conversion to text, this solution is best used for large, unstructured documents, and for when you want to analyze more than the amount of files supported in the first solution (see documentation [here](https://platform.openai.com/docs/actions/sending-files)).\n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to files in Sharpeoint\n\n**Example Use Cases**: \n- A user needs to look up which files relate to a certain topic\n- A user needs an answer to a critical question, buried deep in documents\n\n## Architecture / Example\n\n![](../../../images/solution_2.gif)\n\nThis solution uses a Node.js Azure Function to, based on the logged in user:\n\n1. Search for a relevant file that the user has access to, based on the user\u2019s initial question.\n\n2. For each file that is found, convert it to a consistent readable format and retrieve all the text.\n\n3. Use GPT 4o mini (gpt-4o-mini) to extract the relevant text from the files based on the initial user\u2019s question. Note the pricing of GPT 4o mini [here](https://openai.com/pricing#language-models) - since we are dealing with small token chunks, the cost of this step is nominal.\u00a0\u00a0\n\n4. Returns that data to ChatGPT. The GPT then uses that information to respond to the user's initial question.\n\nAs 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 4o mini.\n\n![](../../../images/solution_2_architecture.png)\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://www.microsoft.com/en-us/microsoft-365/sharepoint/collaboration\n- Application API Documentation: https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Access to a Sharepoint environment \n- Postman (and knowledge of APIs and OAuth)\n- An OpenAI API Key from platform.openai.com\n\n## Middleware Information\n\nIf you follow the [search concept files guide](https://learn.microsoft.com/en-us/graph/search-concept-files), the [Microsoft Graph Search API](https://learn.microsoft.com/en-us/graph/search-concept-files) returns references to files that fit the criteria, but not the file contents themselves. Therefore, middleware is required, rather than hitting the MSFT endpoints directly.\n\nSteps: \n\n1. loop through the returned files and download the files using the [Download File endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0\\&tabs=http) or [Convert File endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http)\n\n2. convert that Binary stream to human readable text using [pdf-parse](https://www.npmjs.com/package/pdf-parse)\n\n3. Then, we can optimize further by summarizing using gpt-4o-mini in the function to help with the 100,000 character limit we impose on Actions today."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 069a8ab2-01f6-4554-9b2a-59bd98e68e95
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"069a8ab2-01f6-4554-9b2a-59bd98e68e95\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d50c61a9-2ad6-4bb6-938c-3d80b5b9d59d\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"0c879e29adca2b1a83d482d2ac059bacc5e4caa529e75cbf46072e2e8997b31f\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f7915a88-99bc-49ed-af30-cbb660a5b080\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"664c4573cc56757082575373837db4382ba9d8d061753e0ab2064e9593bb637d\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2782, \"end_char_idx\": 5992, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "The main difference is that this solution converts the file to text instead of a base64 string, and then summarizes that text using GPT 4o mini.\n\n![](../../../images/solution_2_architecture.png)\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://www.microsoft.com/en-us/microsoft-365/sharepoint/collaboration\n- Application API Documentation: https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Access to a Sharepoint environment \n- Postman (and knowledge of APIs and OAuth)\n- An OpenAI API Key from platform.openai.com\n\n## Middleware Information\n\nIf you follow the [search concept files guide](https://learn.microsoft.com/en-us/graph/search-concept-files), the [Microsoft Graph Search API](https://learn.microsoft.com/en-us/graph/search-concept-files) returns references to files that fit the criteria, but not the file contents themselves. Therefore, middleware is required, rather than hitting the MSFT endpoints directly.\n\nSteps: \n\n1. loop through the returned files and download the files using the [Download File endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0\\&tabs=http) or [Convert File endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http)\n\n2. convert that Binary stream to human readable text using [pdf-parse](https://www.npmjs.com/package/pdf-parse)\n\n3. Then, we can optimize further by summarizing using gpt-4o-mini in the function to help with the 100,000 character limit we impose on Actions today.\u00a0\n\n### Additional Steps\n\n#### Set up Azure Function\n\n1. Set up an Azure Function using the steps in the [Azure Function cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_azure_function)\n\n#### Add in Function Code\n\nNow that you have an authenticated Azure Function, we can update the function to search SharePoint / O365\n\n2. Go to your test function and paste in the code from [this file](https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/solution_two_preprocessing.js). Save the function.\n\n> **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).\n\n3. 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.\n\n    1. `TENANT_ID`: copied from previous section\n\n    2. `CLIENT_ID`: copied from previous section \n\n    3. `OPENAI_API_KEY:` spin up an OpenAI API key on platform.openai.com.\n\n4. Go to the **Console** tab under the **Development Tools**\n\n    1. Install the following packages in console\n\n       1. `npm install @microsoft/microsoft-graph-client`\n\n       2. `npm install axios`\n\n       3. `npm install pdf-parse`\n\n       4. `npm install openai`\n\n5."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: f7915a88-99bc-49ed-af30-cbb660a5b080
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"f7915a88-99bc-49ed-af30-cbb660a5b080\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"069a8ab2-01f6-4554-9b2a-59bd98e68e95\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"050e1d673ce7b25850e2e69ce3e1d7cf12da5eb9ab9b88fa54e84e27618b7933\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"2c8d840b-38ce-418e-b099-774ebe65ede0\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"24580a9bf86d8b884db30bef5d03680d97a7845dd90a0063c3d72ae3ee4a3f70\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4440, \"end_char_idx\": 7527, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "Then, we can optimize further by summarizing using gpt-4o-mini in the function to help with the 100,000 character limit we impose on Actions today.\u00a0\n\n### Additional Steps\n\n#### Set up Azure Function\n\n1. Set up an Azure Function using the steps in the [Azure Function cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_azure_function)\n\n#### Add in Function Code\n\nNow that you have an authenticated Azure Function, we can update the function to search SharePoint / O365\n\n2. Go to your test function and paste in the code from [this file](https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/solution_two_preprocessing.js). Save the function.\n\n> **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).\n\n3. 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.\n\n    1. `TENANT_ID`: copied from previous section\n\n    2. `CLIENT_ID`: copied from previous section \n\n    3. `OPENAI_API_KEY:` spin up an OpenAI API key on platform.openai.com.\n\n4. Go to the **Console** tab under the **Development Tools**\n\n    1. Install the following packages in console\n\n       1. `npm install @microsoft/microsoft-graph-client`\n\n       2. `npm install axios`\n\n       3. `npm install pdf-parse`\n\n       4. `npm install openai`\n\n5. Once this is complete, try calling the function (POST call) from Postman again, putting the below into body (using a query and search term you think will generate responses).\n\n    ```json\n    {\n        \"query\": \"<choose a question>\",\n        \"searchTerm\": \"<choose a search term>\"\n    }\n    ```\n\n6. If you get a response, you are ready to set this up with a Custom GPT!\n\n\n## Detailed Walkthrough\n\nThe below walks through setup instructions and walkthrough unique to this solution of pre-processing the files and extracting summaries in the Azure Function. You can find the entire code [here](https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/solution_two_preprocessing.js).\n\n### Code Walkthrough\n\n#### Implementing the Authentication\u00a0\n\nBelow we have a few helper functions that we\u2019ll use in the function.\n\n#### Initializing the Microsoft Graph Client\nCreate a function to initialize the Graph client with an access token. This will be used to search through Office 365 and SharePoint.\n\n```javascript\nconst { Client } = require('@microsoft/microsoft-graph-client');\n\nfunction initGraphClient(accessToken) {\n    return Client.init({\n        authProvider: (done) => {\n            done(null, accessToken);\n        }\n    });\n}\n```\n\n#### Obtaining an On-Behalf-Of (OBO) Token\nThis function uses an existing bearer token to request an OBO token from Microsoft's identity platform. This enables passing through the credentials to ensure the search only returns files the logged-in user can access."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 2c8d840b-38ce-418e-b099-774ebe65ede0
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"2c8d840b-38ce-418e-b099-774ebe65ede0\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"f7915a88-99bc-49ed-af30-cbb660a5b080\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"4babf8e634f928505356691659b5bf519e459c504694fd5a4d29bd2ef378ac3c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"3681bda0-210e-425b-b582-b1903921f2b7\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4558c52194f55355a17c72861a1550e773c6f7d4569fedcf77e09f384432e7af\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5790, \"end_char_idx\": 9024, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "Install the following packages in console\n\n       1. `npm install @microsoft/microsoft-graph-client`\n\n       2. `npm install axios`\n\n       3. `npm install pdf-parse`\n\n       4. `npm install openai`\n\n5. Once this is complete, try calling the function (POST call) from Postman again, putting the below into body (using a query and search term you think will generate responses).\n\n    ```json\n    {\n        \"query\": \"<choose a question>\",\n        \"searchTerm\": \"<choose a search term>\"\n    }\n    ```\n\n6. If you get a response, you are ready to set this up with a Custom GPT!\n\n\n## Detailed Walkthrough\n\nThe below walks through setup instructions and walkthrough unique to this solution of pre-processing the files and extracting summaries in the Azure Function. You can find the entire code [here](https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/sharepoint_azure_function/solution_two_preprocessing.js).\n\n### Code Walkthrough\n\n#### Implementing the Authentication\u00a0\n\nBelow we have a few helper functions that we\u2019ll use in the function.\n\n#### Initializing the Microsoft Graph Client\nCreate a function to initialize the Graph client with an access token. This will be used to search through Office 365 and SharePoint.\n\n```javascript\nconst { Client } = require('@microsoft/microsoft-graph-client');\n\nfunction initGraphClient(accessToken) {\n    return Client.init({\n        authProvider: (done) => {\n            done(null, accessToken);\n        }\n    });\n}\n```\n\n#### Obtaining an On-Behalf-Of (OBO) Token\nThis function uses an existing bearer token to request an OBO token from Microsoft's identity platform. This enables passing through the credentials to ensure the search only returns files the logged-in user can access.\n\n```javascript\nconst axios = require('axios');\nconst qs = require('querystring');\n\nasync function getOboToken(userAccessToken) {\n    const { TENANT_ID, CLIENT_ID, MICROSOFT_PROVIDER_AUTHENTICATION_SECRET } = process.env;\n    const params = {\n        client_id: CLIENT_ID,\n        client_secret: MICROSOFT_PROVIDER_AUTHENTICATION_SECRET,\n        grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n        assertion: userAccessToken,\n        requested_token_use: 'on_behalf_of',\n        scope: 'https://graph.microsoft.com/.default'\n    };\n\n    const url = `https\\://login.microsoftonline.com/${TENANT_ID}/oauth2/v2.0/token`;\n    try {\n        const response = await axios.post(url, qs.stringify(params), {\n            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }\n        });\n        return response.data.access\\_token;\n    } catch (error) {\n        console.error('Error obtaining OBO token:', error.response?.data || error.message);\n        throw error;\n    }\n}\n```\n\n#### Retrieving Content from O365 / SharePoint Items\n\nThis function fetches the content of drive items, handling different file types and converting files to PDF when necessary for text extraction. This uses the [download endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0\\&tabs=http) for PDFs and the [convert endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http) for other supported file types."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 3681bda0-210e-425b-b582-b1903921f2b7
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"3681bda0-210e-425b-b582-b1903921f2b7\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"2c8d840b-38ce-418e-b099-774ebe65ede0\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"a520e2ec5690520ee22c9ab87728614f1be97fc5d4b8ba9ee52f61d779ce69ba\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d4630808-8fcb-46e1-b087-ec667de98f2f\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"175562afa5784a2cc5d7c82a2e3d79f20333f8838a43b191ce93900a64365172\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7412, \"end_char_idx\": 10317, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "This enables passing through the credentials to ensure the search only returns files the logged-in user can access.\n\n```javascript\nconst axios = require('axios');\nconst qs = require('querystring');\n\nasync function getOboToken(userAccessToken) {\n    const { TENANT_ID, CLIENT_ID, MICROSOFT_PROVIDER_AUTHENTICATION_SECRET } = process.env;\n    const params = {\n        client_id: CLIENT_ID,\n        client_secret: MICROSOFT_PROVIDER_AUTHENTICATION_SECRET,\n        grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n        assertion: userAccessToken,\n        requested_token_use: 'on_behalf_of',\n        scope: 'https://graph.microsoft.com/.default'\n    };\n\n    const url = `https\\://login.microsoftonline.com/${TENANT_ID}/oauth2/v2.0/token`;\n    try {\n        const response = await axios.post(url, qs.stringify(params), {\n            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }\n        });\n        return response.data.access\\_token;\n    } catch (error) {\n        console.error('Error obtaining OBO token:', error.response?.data || error.message);\n        throw error;\n    }\n}\n```\n\n#### Retrieving Content from O365 / SharePoint Items\n\nThis function fetches the content of drive items, handling different file types and converting files to PDF when necessary for text extraction. This uses the [download endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0\\&tabs=http) for PDFs and the [convert endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http) for other supported file types.\n```javascript\nconst getDriveItemContent = async (client, driveId, itemId, name) => {\n    try {\n        const fileType = path.extname(name).toLowerCase();\n        // the below files types are the ones that are able to be converted to PDF to extract the text. See https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0&tabs=http\n        const allowedFileTypes = ['.pdf', '.doc', '.docx', '.odp', '.ods', '.odt', '.pot', '.potm', '.potx', '.pps', '.ppsx', '.ppsxm', '.ppt', '.pptm', '.pptx', '.rtf'];\n        // filePath changes based on file type, adding ?format=pdf to convert non-pdf types to pdf for text extraction, so all files in allowedFileTypes above are converted to pdf\n        const filePath = `/drives/${driveId}/items/${itemId}/content` + ((fileType === '.pdf' || fileType === '.txt' || fileType === '.csv') ? '' : '?format=pdf');\n        if (allowedFileTypes.includes(fileType)) {\n            response = await client.api(filePath).getStream();\n            // The below takes the chunks in response and combines\n            let chunks = [];\n            for await (let chunk of response) {\n                chunks.push(chunk);\n            }\n            let buffer = Buffer.concat(chunks);\n            // the below extracts the text from the PDF."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: d4630808-8fcb-46e1-b087-ec667de98f2f
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"d4630808-8fcb-46e1-b087-ec667de98f2f\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"3681bda0-210e-425b-b582-b1903921f2b7\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"49132c560b4a98c197aa4c85b86720e60d369c6bc800ad48809c20db3a2974c4\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"badb3d52-1f95-4f52-925e-880e8d97ffc6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b17f18c930c6ac111ed1b4cb1b5f54b60bae6a5e2373b9728f56c8ba43af4bfd\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8720, \"end_char_idx\": 11945, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "This uses the [download endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0\\&tabs=http) for PDFs and the [convert endpoint](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http) for other supported file types.\n```javascript\nconst getDriveItemContent = async (client, driveId, itemId, name) => {\n    try {\n        const fileType = path.extname(name).toLowerCase();\n        // the below files types are the ones that are able to be converted to PDF to extract the text. See https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0&tabs=http\n        const allowedFileTypes = ['.pdf', '.doc', '.docx', '.odp', '.ods', '.odt', '.pot', '.potm', '.potx', '.pps', '.ppsx', '.ppsxm', '.ppt', '.pptm', '.pptx', '.rtf'];\n        // filePath changes based on file type, adding ?format=pdf to convert non-pdf types to pdf for text extraction, so all files in allowedFileTypes above are converted to pdf\n        const filePath = `/drives/${driveId}/items/${itemId}/content` + ((fileType === '.pdf' || fileType === '.txt' || fileType === '.csv') ? '' : '?format=pdf');\n        if (allowedFileTypes.includes(fileType)) {\n            response = await client.api(filePath).getStream();\n            // The below takes the chunks in response and combines\n            let chunks = [];\n            for await (let chunk of response) {\n                chunks.push(chunk);\n            }\n            let buffer = Buffer.concat(chunks);\n            // the below extracts the text from the PDF.\n            const pdfContents = await pdfParse(buffer);\n            return pdfContents.text;\n        } else if (fileType === '.txt') {\n            // If the type is txt, it does not need to create a stream and instead just grabs the content\n            response = await client.api(filePath).get();\n            return response;\n        }  else if (fileType === '.csv') {\n            response = await client.api(filePath).getStream();\n            let chunks = [];\n            for await (let chunk of response) {\n                chunks.push(chunk);\n            }\n            let buffer = Buffer.concat(chunks);\n            let dataString = buffer.toString('utf-8');\n            return dataString\n            \n    } else {\n        return 'Unsupported File Type';\n    }\n     \n    } catch (error) {\n        console.error('Error fetching drive content:', error);\n        throw new Error(`Failed to fetch content for ${name}: ${error.message}`);\n    }\n};\n```\n\n#### Integrating GPT 4o mini for Text Analysis\n\nThis function utilizes the OpenAI SDK to analyze text extracted from documents and find relevant information based on a user query. This helps to ensure only relevant text to the user\u2019s question is returned to the GPT.\u00a0\n\n```javascript\nconst getRelevantParts = async (text, query) => {\n    try {\n        // We use your OpenAI key to initialize the OpenAI client\n        const openAIKey = process.env[\"OPENAI_API_KEY\"];\n        const openai = new OpenAI({\n            apiKey: openAIKey,\n        });\n        const response = await openai.chat.completions.create({\n            // Using gpt-4o-mini due to speed to prevent timeouts."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: badb3d52-1f95-4f52-925e-880e8d97ffc6
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"badb3d52-1f95-4f52-925e-880e8d97ffc6\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d4630808-8fcb-46e1-b087-ec667de98f2f\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"e4e22ac5fd7eaca6470cc20d76353bc4382278bd447d0b44c6a9ed0170ee0db9\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d7b68f55-e8af-4b65-b84a-af8faf390535\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"9494567576bf19e6efd626c8802f6e519e4b30ae3772115610f74cf87376f541\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10330, \"end_char_idx\": 13904, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "const pdfContents = await pdfParse(buffer);\n            return pdfContents.text;\n        } else if (fileType === '.txt') {\n            // If the type is txt, it does not need to create a stream and instead just grabs the content\n            response = await client.api(filePath).get();\n            return response;\n        }  else if (fileType === '.csv') {\n            response = await client.api(filePath).getStream();\n            let chunks = [];\n            for await (let chunk of response) {\n                chunks.push(chunk);\n            }\n            let buffer = Buffer.concat(chunks);\n            let dataString = buffer.toString('utf-8');\n            return dataString\n            \n    } else {\n        return 'Unsupported File Type';\n    }\n     \n    } catch (error) {\n        console.error('Error fetching drive content:', error);\n        throw new Error(`Failed to fetch content for ${name}: ${error.message}`);\n    }\n};\n```\n\n#### Integrating GPT 4o mini for Text Analysis\n\nThis function utilizes the OpenAI SDK to analyze text extracted from documents and find relevant information based on a user query. This helps to ensure only relevant text to the user\u2019s question is returned to the GPT.\u00a0\n\n```javascript\nconst getRelevantParts = async (text, query) => {\n    try {\n        // We use your OpenAI key to initialize the OpenAI client\n        const openAIKey = process.env[\"OPENAI_API_KEY\"];\n        const openai = new OpenAI({\n            apiKey: openAIKey,\n        });\n        const response = await openai.chat.completions.create({\n            // Using gpt-4o-mini due to speed to prevent timeouts. You can tweak this prompt as needed\n            model: \"gpt-4o-mini\",\n            messages: [\n                {\"role\": \"system\", \"content\": \"You are a helpful assistant that finds relevant content in text based on a query. You only return the relevant sentences, and you return a maximum of 10 sentences\"},\n                {\"role\": \"user\", \"content\": `Based on this question: **\"${query}\"**, get the relevant parts from the following text:*****\\n\\n${text}*****. If you cannot answer the question based on the text, respond with 'No information provided'`}\n            ],\n            // using temperature of 0 since we want to just extract the relevant content\n            temperature: 0,\n            // using max_tokens of 1000, but you can customize this based on the number of documents you are searching. \n            max_tokens: 1000\n        });\n        return response.choices[0].message.content;\n    } catch (error) {\n        console.error('Error with OpenAI:', error);\n        return 'Error processing text with OpenAI' + error;\n    }\n};\n```\n\n#### Creating the Azure Function to Handle Requests\n\nNow that we have all these helper functions, the Azure Function will orchestrate the flow, by authenticating the user, performing the search, and iterating through the search results to extract the text and retrieve the relevant parts of the text to the GPT.\n\n**Handling HTTP Requests:** The function starts by extracting the query and searchTerm from the HTTP request. It checks if the Authorization header is present and extracts the bearer token.\n\n**Authentication:** Using the bearer token, it obtains an OBO token from Microsoft's identity platform using getOboToken defined above.\n\n**Initializing the Graph Client:** With the OBO token, it initializes the Microsoft Graph client using initGraphClient defined above.\n\n**Document Search:** It constructs a search query and sends it to the Microsoft Graph API to find documents based on the searchTerm."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: d7b68f55-e8af-4b65-b84a-af8faf390535
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"d7b68f55-e8af-4b65-b84a-af8faf390535\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"badb3d52-1f95-4f52-925e-880e8d97ffc6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"0181bbfa68aefd32d2c2483e74f9a069b9cee8c2940723b5ff7ebb0e8080848b\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"253c39b2-896b-4b17-ba43-73e5a65187c5\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"be676deb2006b94321d8fc57dd8b857e6530e26b35a2d894bfc254d7714d0e76\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 12169, \"end_char_idx\": 15817, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "You only return the relevant sentences, and you return a maximum of 10 sentences\"},\n                {\"role\": \"user\", \"content\": `Based on this question: **\"${query}\"**, get the relevant parts from the following text:*****\\n\\n${text}*****. If you cannot answer the question based on the text, respond with 'No information provided'`}\n            ],\n            // using temperature of 0 since we want to just extract the relevant content\n            temperature: 0,\n            // using max_tokens of 1000, but you can customize this based on the number of documents you are searching. \n            max_tokens: 1000\n        });\n        return response.choices[0].message.content;\n    } catch (error) {\n        console.error('Error with OpenAI:', error);\n        return 'Error processing text with OpenAI' + error;\n    }\n};\n```\n\n#### Creating the Azure Function to Handle Requests\n\nNow that we have all these helper functions, the Azure Function will orchestrate the flow, by authenticating the user, performing the search, and iterating through the search results to extract the text and retrieve the relevant parts of the text to the GPT.\n\n**Handling HTTP Requests:** The function starts by extracting the query and searchTerm from the HTTP request. It checks if the Authorization header is present and extracts the bearer token.\n\n**Authentication:** Using the bearer token, it obtains an OBO token from Microsoft's identity platform using getOboToken defined above.\n\n**Initializing the Graph Client:** With the OBO token, it initializes the Microsoft Graph client using initGraphClient defined above.\n\n**Document Search:** It constructs a search query and sends it to the Microsoft Graph API to find documents based on the searchTerm.\n\n**Document Processing**: For each document returned by the search:\n\n- It retrieves the document content using getDriveItemContent.\n\n- If the file type is supported, it analyzes the content using getRelevantParts, which sends the text to OpenAI's model for extracting relevant information based on the query.\n\n- It collects the analysis results and includes metadata like the document name and URL.\n\n**Response**: The function sorts the results by relevance and sends them back in the HTTP response.\n\n```javascript\nmodule.exports = async function (context, req) {\n    const query = req.query.query || (req.body && req.body.query);\n    const searchTerm = req.query.searchTerm || (req.body && req.body.searchTerm);\n    if (!req.headers.authorization) {\n        context.res = {\n            status: 400,\n            body: 'Authorization header is missing'\n        };\n        return;\n    }\n    /// The below takes the token passed to the function, to use to get an OBO token.\n    const bearerToken = req.headers.authorization.split(' ')[1];\n    let accessToken;\n    try {\n        accessToken = await getOboToken(bearerToken);\n    } catch (error) {\n        context.res = {\n            status: 500,\n            body: `Failed to obtain OBO token: ${error.message}`\n        };\n        return;\n    }\n    // Initialize the Graph Client using the initGraphClient function defined above\n    let client = initGraphClient(accessToken);\n    // this is the search body to be used in the Microsft Graph Search API: https://learn.microsoft.com/en-us/graph/search-concept-files\n    const requestBody = {\n        requests: [\n            {\n                entityTypes: ['driveItem'],\n                query: {\n                    queryString: searchTerm\n                },\n                from: 0,\n                // the below is set to summarize the top 10 search results from the Graph API, but can configure based on your documents."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 253c39b2-896b-4b17-ba43-73e5a65187c5
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"253c39b2-896b-4b17-ba43-73e5a65187c5\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d7b68f55-e8af-4b65-b84a-af8faf390535\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"4ee3158e7ed5741ea541a76515c23329545c73cf6d9482a28c9a433fdf16243e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f11335f7-0d99-409d-a241-eefbd7dfa22b\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ada524fd571cbf3ec2ccf3fb2a52eb3955843ac086c1ae47598e4412f3e09ed2\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 13906, \"end_char_idx\": 15950, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "**Document Processing**: For each document returned by the search:\n\n- It retrieves the document content using getDriveItemContent.\n\n- If the file type is supported, it analyzes the content using getRelevantParts, which sends the text to OpenAI's model for extracting relevant information based on the query.\n\n- It collects the analysis results and includes metadata like the document name and URL.\n\n**Response**: The function sorts the results by relevance and sends them back in the HTTP response.\n\n```javascript\nmodule.exports = async function (context, req) {\n    const query = req.query.query || (req.body && req.body.query);\n    const searchTerm = req.query.searchTerm || (req.body && req.body.searchTerm);\n    if (!req.headers.authorization) {\n        context.res = {\n            status: 400,\n            body: 'Authorization header is missing'\n        };\n        return;\n    }\n    /// The below takes the token passed to the function, to use to get an OBO token.\n    const bearerToken = req.headers.authorization.split(' ')[1];\n    let accessToken;\n    try {\n        accessToken = await getOboToken(bearerToken);\n    } catch (error) {\n        context.res = {\n            status: 500,\n            body: `Failed to obtain OBO token: ${error.message}`\n        };\n        return;\n    }\n    // Initialize the Graph Client using the initGraphClient function defined above\n    let client = initGraphClient(accessToken);\n    // this is the search body to be used in the Microsft Graph Search API: https://learn.microsoft.com/en-us/graph/search-concept-files\n    const requestBody = {\n        requests: [\n            {\n                entityTypes: ['driveItem'],\n                query: {\n                    queryString: searchTerm\n                },\n                from: 0,\n                // the below is set to summarize the top 10 search results from the Graph API, but can configure based on your documents. \n                size: 10\n            }\n        ]\n    };\n\n    try { \n        // Function to tokenize content (e.g., based on words)."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: f11335f7-0d99-409d-a241-eefbd7dfa22b
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"f11335f7-0d99-409d-a241-eefbd7dfa22b\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"253c39b2-896b-4b17-ba43-73e5a65187c5\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"2f31001a537e085327786ed5231566ab380dd4770824ab9d95f213c180853927\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"cd321455-d3b6-4fd5-9859-06d3b790af22\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4285ee4fb199e3ef7d27569ec6aac3e35e01892efbd1ac4423a78556ac2ae142\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 14038, \"end_char_idx\": 19238, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "- If the file type is supported, it analyzes the content using getRelevantParts, which sends the text to OpenAI's model for extracting relevant information based on the query.\n\n- It collects the analysis results and includes metadata like the document name and URL.\n\n**Response**: The function sorts the results by relevance and sends them back in the HTTP response.\n\n```javascript\nmodule.exports = async function (context, req) {\n    const query = req.query.query || (req.body && req.body.query);\n    const searchTerm = req.query.searchTerm || (req.body && req.body.searchTerm);\n    if (!req.headers.authorization) {\n        context.res = {\n            status: 400,\n            body: 'Authorization header is missing'\n        };\n        return;\n    }\n    /// The below takes the token passed to the function, to use to get an OBO token.\n    const bearerToken = req.headers.authorization.split(' ')[1];\n    let accessToken;\n    try {\n        accessToken = await getOboToken(bearerToken);\n    } catch (error) {\n        context.res = {\n            status: 500,\n            body: `Failed to obtain OBO token: ${error.message}`\n        };\n        return;\n    }\n    // Initialize the Graph Client using the initGraphClient function defined above\n    let client = initGraphClient(accessToken);\n    // this is the search body to be used in the Microsft Graph Search API: https://learn.microsoft.com/en-us/graph/search-concept-files\n    const requestBody = {\n        requests: [\n            {\n                entityTypes: ['driveItem'],\n                query: {\n                    queryString: searchTerm\n                },\n                from: 0,\n                // the below is set to summarize the top 10 search results from the Graph API, but can configure based on your documents. \n                size: 10\n            }\n        ]\n    };\n\n    try { \n        // Function to tokenize content (e.g., based on words). \n        const tokenizeContent = (content) => {\n            return content.split(/\\s+/);\n        };\n\n        // Function to break tokens into 10k token windows for gpt-4o-mini\n        const breakIntoTokenWindows = (tokens) => {\n            const tokenWindows = []\n            const maxWindowTokens = 10000; // 10k tokens\n            let startIndex = 0;\n\n            while (startIndex < tokens.length) {\n                const window = tokens.slice(startIndex, startIndex + maxWindowTokens);\n                tokenWindows.push(window);\n                startIndex += maxWindowTokens;\n            }\n\n            return tokenWindows;\n        };\n        // This is where we are doing the search\n        const list = await client.api('/search/query').post(requestBody);\n\n        const processList = async () => {\n            // This will go through and for each search response, grab the contents of the file and summarize with gpt-4o-mini\n            const results = [];\n\n            await Promise.all(list.value[0].hitsContainers.map(async (container) => {\n                for (const hit of container.hits) {\n                    if (hit.resource[\"@odata.type\"] === \"#microsoft.graph.driveItem\") {\n                        const { name, id } = hit.resource;\n                        // We use the below to grab the URL of the file to include in the response\n                        const webUrl = hit.resource.webUrl.replace(/\\s/g, \"%20\");\n                        // The Microsoft Graph API ranks the reponses, so we use this to order it\n                        const rank = hit.rank;\n                        // The below is where the file lives\n                        const driveId = hit.resource.parentReference.driveId;\n                        const contents = await getDriveItemContent(client, driveId, id, name);\n                        if (contents !== 'Unsupported File Type') {\n                            // Tokenize content using function defined previously\n                            const tokens = tokenizeContent(contents);\n\n                            // Break tokens into 10k token windows\n                            const tokenWindows = breakIntoTokenWindows(tokens);\n\n                            // Process each token window and combine results\n                            const relevantPartsPromises = tokenWindows.map(window => getRelevantParts(window.join(' '), query));\n                            const relevantParts = await Promise.all(relevantPartsPromises);\n                            const combinedResults = relevantParts.join('\\n'); // Combine results\n\n                            results.push({ name, webUrl, rank, contents: combinedResults });\n                        } \n                        else {\n                            results.push({ name, webUrl, rank, contents: 'Unsupported File Type' });\n                        }\n                    }\n                }\n            }));\n\n            return results;\n        };\n        let results;\n        if (list.value[0].hitsContainers[0].total == 0) {\n            // Return no results found to the API if the Microsoft Graph API returns no results\n            results = 'No results found';\n        } else {\n            // If the Microsoft Graph API does return results, then run processList to iterate through."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: cd321455-d3b6-4fd5-9859-06d3b790af22
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"cd321455-d3b6-4fd5-9859-06d3b790af22\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"f11335f7-0d99-409d-a241-eefbd7dfa22b\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"2be94bfa77976684174c41730a31f9866f2d4434da0bf9e9e38a6c84ded9c9ca\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"364ca0e1-bb44-4356-93e9-33c7df8c1c88\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"81b5ea3f42ac50c6082230d37b203b4a8293be492fc29a8321e924bbc74fa81b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 19251, \"end_char_idx\": 21083, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "results = await processList();\n            results.sort((a, b) => a.rank - b.rank);\n        }\n        context.res = {\n            status: 200,\n            body: results\n        };\n    } catch (error) {\n        context.res = {\n            status: 500,\n            body: `Error performing search or processing results: ${error.message}`,\n        };\n    }\n};\n```\n\n### Customizations\n\nBelow are some potential areas to customize.\u00a0\n\n- You can customize the GPT prompt to search again a certain amount of times if nothing is found.\n\n- You can customize the code to only search through specific SharePoint sites or O365 Drives by customizing the search query. This will help focus the search and improve the retrieval. The function as setup now looks through all files the logged-in user can access.\n\n- You could use gpt-4o instead of gpt-4o-mini. This would slightly increase the cost and latency, but you may get higher quality summarizations.\n\n- You can customize the amount of files it searches through within the call to Microsoft Graph.\n\n\n### Considerations\n\nNote that all the same limitations of Actions apply here, with regards to returning 100K characters or less and the [45 second timeout](https://platform.openai.com/docs/actions/production/timeouts).\n\n\n- This only works for text, not for images. With some additional code in the Azure Function, you could customize this by using GPT-4o to extract summarizations of images.\n\n- This does not work for structured data. We recommend Solution 1 if structured data is a major part of your use case.\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 364ca0e1-bb44-4356-93e9-33c7df8c1c88
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"364ca0e1-bb44-4356-93e9-33c7df8c1c88\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"cd321455-d3b6-4fd5-9859-06d3b790af22\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"663fd0c03d4815a480eca1a9a0b575fa99ebcc20704cb6d08b752e9ce4b12432\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0d8dce93-901a-4aec-b430-1b0af10ed45e\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"087d3578ad1060509da92b5592ca5dae883e732b59df56a47dbf6617393fdb31\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 19251, \"end_char_idx\": 23258, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "results = await processList();\n            results.sort((a, b) => a.rank - b.rank);\n        }\n        context.res = {\n            status: 200,\n            body: results\n        };\n    } catch (error) {\n        context.res = {\n            status: 500,\n            body: `Error performing search or processing results: ${error.message}`,\n        };\n    }\n};\n```\n\n### Customizations\n\nBelow are some potential areas to customize.\u00a0\n\n- You can customize the GPT prompt to search again a certain amount of times if nothing is found.\n\n- You can customize the code to only search through specific SharePoint sites or O365 Drives by customizing the search query. This will help focus the search and improve the retrieval. The function as setup now looks through all files the logged-in user can access.\n\n- You could use gpt-4o instead of gpt-4o-mini. This would slightly increase the cost and latency, but you may get higher quality summarizations.\n\n- You can customize the amount of files it searches through within the call to Microsoft Graph.\n\n\n### Considerations\n\nNote that all the same limitations of Actions apply here, with regards to returning 100K characters or less and the [45 second timeout](https://platform.openai.com/docs/actions/production/timeouts).\n\n\n- This only works for text, not for images. With some additional code in the Azure Function, you could customize this by using GPT-4o to extract summarizations of images.\n\n- This does not work for structured data. We recommend Solution 1 if structured data is a major part of your use case.\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nYou are a Q&A helper that helps answer users questions. You have access to a documents repository through your API action. When a user asks a question, you pass in that question exactly as stated to the \"query\" parameter, and for the \"searchTerm\" you use a single keyword or term you think you should use for the search.\n\n****\n\nScenario 1: There are answers\n\nIf your action returns results, then you take the results from the action and summarize concisely with the webUrl returned from the action. You answer the users question to the best of your knowledge from the action\n\n****\n\nScenario 2: No results found\n\nIf the response you get from the action is \"No results found\", stop there and let the user know there were no results and that you are going to try a different search term, and explain why. You must always let the user know before conducting another search.\n\nExample:\n\n****\n\nI found no results for \"DEI\". I am now going to try [insert term] because [insert explanation]\n\n****\n\nThen, try a different searchTerm that is similar to the one you tried before, with a single word.\u00a0\n\nTry this three times. After the third time, then let the user know you did not find any relevant documents to answer the question, and to check SharePoint. Be sure to be explicit about what you are searching for at each step.\n\n****\n\nIn either scenario, try to answer the user's question. If you cannot answer the user's question based on the knowledge you find, let the user know and ask them to go check the HR Docs in SharePoint. If the file is a CSV, XLSX, or XLS, you can tell the user to download the file using the link and re-upload to use Advanced Data Analysis.\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\nThe below spec passes in the `query` parameter to inform the pre-processing and a `searchTerm` to find the right files in Microsoft Graph.\n>Make sure to switch the function app name, function name and code based on link copied in screenshot above"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 0d8dce93-901a-4aec-b430-1b0af10ed45e
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"0d8dce93-901a-4aec-b430-1b0af10ed45e\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"364ca0e1-bb44-4356-93e9-33c7df8c1c88\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"c55a9eb2b5d1398e0286f09511abaab34c46b767cdf415c9c1945e1f000f7d45\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"1be0f9ad-c9f0-42b4-bfe4-dd88b4fed90a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"9da297155d9b7eccca24550bdaef40745cde3f4162cabb0cf922ba571d183b39\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 23261, \"end_char_idx\": 26896, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "```python\nopenapi: 3.1.0\ninfo:\n  title: SharePoint Search API\n  description: API for searching SharePoint documents.\n  version: 1.0.0\nservers:\n  - url: https://{your_function_app_name}.azurewebsites.net/api\n    description: SharePoint Search API server\npaths:\n  /{your_function_name}?code={enter your specific endpoint id here}:\n    post:\n      operationId: searchSharePoint\n      summary: Searches SharePoint for documents matching a query and term.\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                query:\n                  type: string\n                  description: The full query to search for in SharePoint documents.\n                searchTerm:\n                  type: string\n                  description: A specific term to search for within the documents.\n      responses:\n        '200':\n          description: Search results\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  type: object\n                  properties:\n                    documentName:\n                      type: string\n                      description: The name of the document.\n                    snippet:\n                      type: string\n                      description: A snippet from the document containing the search term.\n                    url:\n                      type: string\n                      description: The URL to access the document.\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n*See above and on the [Azure Function cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_azure_function) for more detailed instructions on authentication.*\n\n## FAQ & Troubleshooting\n\n- Why are you using the Microsoft Graph API in your code instead of the [SharePoint API](https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service?tabs=csom)?\n\n  - The SharePoint API is legacy - per the Microsoft documentation [here](https://learn.microsoft.com/en-us/sharepoint/dev/apis/sharepoint-rest-graph), \u201cFor SharePoint Online, innovation using a REST API against SharePoint is driven via the Microsoft Graph REST API's.\u201d The Graph API gives us more flexibility, and the SharePoint API still runs into the same file issues listed in the [Why is this necessary instead of interacting with the Microsoft Graph API directly?](#why-is-this-necessary-instead-of-interacting-with-the-microsoft-api-directly) section.\n\n- What types of files does this support?\n    1. This supports all files listed in the documentation for the Convert File endpoint [_here_](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http). Specifically, it supports _pdf, doc, docx, odp, ods, odt, pot, potm, potx, pps, ppsx, ppsxm, ppt, pptm, pptx, rtf_.\n\n    2. When a search result returns XLS, XLSX, or CSV, this prompts the user to download the file and re-upload to ask questions using Advanced Data Analysis. As stated above, we recommend solution 1 if structured data is part of your use case.\n\n- Why do I need to request an OBO token?\n\n  - When you try to use the same token to authenticate to the Graph API as the one you use to authenticate into the Azure Function, you get an \u201cinvalid audience\u201d token."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 1be0f9ad-c9f0-42b4-bfe4-dd88b4fed90a
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb", "title": "GPT Action Library: Sharepoint (Return as Document)", "tokens": 5886, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"1be0f9ad-c9f0-42b4-bfe4-dd88b4fed90a\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"1bf0762cbb08ce257d5016a28e56e66eaa081414347c80627b84e7aece8463d0\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"0d8dce93-901a-4aec-b430-1b0af10ed45e\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_sharepoint_text.ipynb\", \"title\": \"GPT Action Library: Sharepoint (Return as Document)\", \"tokens\": 5886, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"82c53ec8ca6aef83c1d5276c290b095fad4fe91dedd3b37ba6dcc2e27b3004bb\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 25287, \"end_char_idx\": 27731, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "ref_doc_id": "6b505c26-a3e8-4efe-9e3f-3ed5dfd60e45", "chroma:document": "*\n\n## FAQ & Troubleshooting\n\n- Why are you using the Microsoft Graph API in your code instead of the [SharePoint API](https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service?tabs=csom)?\n\n  - The SharePoint API is legacy - per the Microsoft documentation [here](https://learn.microsoft.com/en-us/sharepoint/dev/apis/sharepoint-rest-graph), \u201cFor SharePoint Online, innovation using a REST API against SharePoint is driven via the Microsoft Graph REST API's.\u201d The Graph API gives us more flexibility, and the SharePoint API still runs into the same file issues listed in the [Why is this necessary instead of interacting with the Microsoft Graph API directly?](#why-is-this-necessary-instead-of-interacting-with-the-microsoft-api-directly) section.\n\n- What types of files does this support?\n    1. This supports all files listed in the documentation for the Convert File endpoint [_here_](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0\\&tabs=http). Specifically, it supports _pdf, doc, docx, odp, ods, odt, pot, potm, potx, pps, ppsx, ppsxm, ppt, pptm, pptx, rtf_.\n\n    2. When a search result returns XLS, XLSX, or CSV, this prompts the user to download the file and re-upload to ask questions using Advanced Data Analysis. As stated above, we recommend solution 1 if structured data is part of your use case.\n\n- Why do I need to request an OBO token?\n\n  - When you try to use the same token to authenticate to the Graph API as the one you use to authenticate into the Azure Function, you get an \u201cinvalid audience\u201d token. This is because the audience for the token can only be user\\_impersonation.\n\n  - To address this, the function requests a new token scoped to Files.Read.All within the app using the [On Behalf Of flow](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-on-behalf-of-flow). This will inherit the permissions of the logged in user, meaning this function will only search through files the logged-in user has access to.\u00a0\n\n  - We are purposefully requesting a new On Behalf Of token with each request, because Azure Function Apps are meant to be stateless. You could potentially integrate this with Azure Key Vault to store the secret and retrieve programmatically.\u00a0\n\n*Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look.*"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 8e9104b0-6645-40c0-9fda-8bfd47bc6249
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb", "title": "GPT Actions - Snowflake direct", "tokens": 2052, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"8e9104b0-6645-40c0-9fda-8bfd47bc6249\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"88c46207-4331-4ae6-b7d2-a2050372f0ae\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"775ee052d13a93925560fb565cf2c6f1b26b76866b5598edbac5307e876346b1\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"9e18b91d-bc29-4de9-b309-7a251deeb0f1\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"dc901f252cd6ab3135cbeb7e25300ed401c5a83bb48991107affe28c703dc459\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2650, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "ref_doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "chroma:document": "# GPT Actions - Snowflake direct\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information:\n\n\n\n* [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n* [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n* [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to a Snowflake Data Warehouse. This Action takes a user\u2019s question, scans the relevant tables to gather the data schema, then writes a SQL query to answer the user\u2019s question.\n\nNote: This cookbook return back a [ResultSet SQL statement](https://docs.snowflake.com/en/developer-guide/sql-api/handling-responses#getting-the-data-from-the-results), rather than the full result that is not limited by GPT Actions application/json payload limit. For production and advanced use-case, a middleware is required to return back a CSV file. You can follow instructions in the [GPT Actions - Snowflake Middleware cookbook](../gpt_action_snowflake_middleware) to implement this flow instead.\n\n### Value + Example Business Use Cases\n\n\nValue: Users can now leverage ChatGPT's natural language capability to connect directly to Snowflake\u2019s Data Warehouse..\n\nExample Use Cases:\n\n\n\n* Data scientists can connect to tables and run data analyses using ChatGPT's Data Analysis\n* Citizen data users can ask basic questions of their transactional data\n* Users gain more visibility into their data & potential anomalies\n\n## Application Information\n\n### Application Key Links\n\n\nCheck out these links from the application before you get started:\n\n* Application Website: [https://app.snowflake.com/](https://app.snowflake.com/)\n* Application API Documentation: [https://docs.snowflake.com/en/developer-guide/sql-api/intro](https://docs.snowflake.com/en/developer-guide/sql-api/intro)\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n\n* Provision a Snowflake Data Warehouse\n* Ensure that the user authenticating into Snowflake via ChatGPT has access to the database, schemas, and tables with the necessary role\n\n## ChatGPT Steps\n\n\n### Custom GPT Instructions\n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 9e18b91d-bc29-4de9-b309-7a251deeb0f1
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb", "title": "GPT Actions - Snowflake direct", "tokens": 2052, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"9e18b91d-bc29-4de9-b309-7a251deeb0f1\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"88c46207-4331-4ae6-b7d2-a2050372f0ae\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"775ee052d13a93925560fb565cf2c6f1b26b76866b5598edbac5307e876346b1\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"8e9104b0-6645-40c0-9fda-8bfd47bc6249\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"77a98b8f1e0b50b841f80c0606d2252bc1aeda151e92a7ea226fcda5aa3856ed\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5cbdab75-0978-4d07-b52c-6990e6726a60\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"35927bfd164865e6a47d9058e1bbf102a40dfd7de6edbb2d183728033530c406\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 1321, \"end_char_idx\": 4489, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "ref_doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "chroma:document": "Value: Users can now leverage ChatGPT's natural language capability to connect directly to Snowflake\u2019s Data Warehouse..\n\nExample Use Cases:\n\n\n\n* Data scientists can connect to tables and run data analyses using ChatGPT's Data Analysis\n* Citizen data users can ask basic questions of their transactional data\n* Users gain more visibility into their data & potential anomalies\n\n## Application Information\n\n### Application Key Links\n\n\nCheck out these links from the application before you get started:\n\n* Application Website: [https://app.snowflake.com/](https://app.snowflake.com/)\n* Application API Documentation: [https://docs.snowflake.com/en/developer-guide/sql-api/intro](https://docs.snowflake.com/en/developer-guide/sql-api/intro)\n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n\n* Provision a Snowflake Data Warehouse\n* Ensure that the user authenticating into Snowflake via ChatGPT has access to the database, schemas, and tables with the necessary role\n\n## ChatGPT Steps\n\n\n### Custom GPT Instructions\n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\n**Context**: You are an expert at writing Snowflake SQL queries. A user is going to ask you a question. \n\n**Instructions**:\n1. No matter the user's question, start by running `runQuery` operation using this query: \"SELECT column_name, table_name, data_type, comment FROM `{database}.INFORMATION_SCHEMA.COLUMNS`\" \n-- Assume warehouse = \"<insert your default warehouse here>\", database = \"<insert your default database here>\", unless the user provides different values \n2. Convert the user's question into a SQL statement that leverages the step above and run the `runQuery` operation on that SQL statement to confirm the query works. Add a limit of 100 rows\n3. Now remove the limit of 100 rows and return back the query for the user to see\n4. Use the <your role> role when querying Snowflake\n5. Run each step in sequence. Explain what you are doing in a few sentences, run the action, and then explain what you learned. This will help the user understand the reason behind your workflow. \n\n**Additional Notes**: If the user says \"Let's get started\", explain that the user can provide a project or dataset, along with a question they want answered. If the user has no ideas, suggest that we have a sample flights dataset they can query - ask if they want you to query that\n```\n\n\n### OpenAPI Schema\n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Snowflake Statements API\n  version: 1.0.0\n  description: API for executing statements in Snowflake with specific warehouse and role settings.\nservers:\n  - url: 'https://<your server ID>.<your cloud region>.<your cloud provider>.snowflakecomputing.com/api/v2'"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 5cbdab75-0978-4d07-b52c-6990e6726a60
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb", "title": "GPT Actions - Snowflake direct", "tokens": 2052, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"5cbdab75-0978-4d07-b52c-6990e6726a60\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"88c46207-4331-4ae6-b7d2-a2050372f0ae\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"775ee052d13a93925560fb565cf2c6f1b26b76866b5598edbac5307e876346b1\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"9e18b91d-bc29-4de9-b309-7a251deeb0f1\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"7df252ae313d05d2d4ca6c690d03fe01e8f8c5defa08dc166e6c39d6c03e7474\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0fcdd102-93b8-45bc-884b-2f353f31c1f5\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ea25c28fb4e193ecc396f37a0d36ee4044cfd8a980423ac1393efa74e60cbc56\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3940, \"end_char_idx\": 7576, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "ref_doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "chroma:document": "### OpenAPI Schema\n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Snowflake Statements API\n  version: 1.0.0\n  description: API for executing statements in Snowflake with specific warehouse and role settings.\nservers:\n  - url: 'https://<your server ID>.<your cloud region>.<your cloud provider>.snowflakecomputing.com/api/v2'\n\n\npaths:\n  /statements:\n    post:\n      summary: Execute a SQL statement in Snowflake\n      description: This endpoint allows users to execute a SQL statement in Snowflake, specifying the warehouse and roles to use.\n      operationId: runQuery\n      tags:\n        - Statements\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                warehouse:\n                  type: string\n                  description: The name of the Snowflake warehouse to use for the statement execution.\n                role:\n                  type: string\n                  description: The Snowflake role to assume for the statement execution.\n                statement:\n                  type: string\n                  description: The SQL statement to execute.\n              required:\n                - warehouse\n                - role\n                - statement\n      responses:\n        '200':\n          description: Successful execution of the SQL statement.\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  status:\n                    type: string\n                  data:\n                    type: object\n                    additionalProperties: true\n        '400':\n          description: Bad request, e.g., invalid SQL statement or missing parameters.\n        '401':\n          description: Authentication error, invalid API credentials.\n        '500':\n          description: Internal server error.\n```\n\n## Authentication Instructions\n\nBelow are instructions on setting up authentication with this 3rd party application. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n### Pre-Action Steps\n\nBefore you set up authentication in ChatGPT, please take the following steps in the application.\n\n* Review the Snowflake OAuth Overview: [https://docs.snowflake.com/en/user-guide/oauth-snowflake-overview](https://docs.snowflake.com/en/user-guide/oauth-snowflake-overview)\n* Go to the Snowflake Worksheets\n* Create new OAuth credentials through a [Security Integration](https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-oauth-snowflake) - you will need a new one for each OAuth app/custom GPT since Snowflake Redirect URIs are 1-1 mapped to Security Integrations\n\n\n\n```python\nCREATE SECURITY INTEGRATION CHATGPT_INTEGRATION\n  TYPE = OAUTH\n  ENABLED = TRUE\n  OAUTH_CLIENT = CUSTOM\n  OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'\n  OAUTH_REDIRECT_URI = 'https://oauth.pstmn.io/v1/callback' --- // this is a temporary value while testing your integration. You will replace this with the value your GPT provides\n  OAUTH_ISSUE_REFRESH_TOKENS = TRUE\n  OAUTH_REFRESH_TOKEN_VALIDITY = 7776000;\n```\n\n\n* Retrieve your OAuth Client ID, Auth URL, and Token URL\n\n\n\n```python\nDESCRIBE SECURITY INTEGRATION CHATGPT_INTEGRATION;\n```\n\n\nYou\u2019ll find the required information in these 3 columns:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 0fcdd102-93b8-45bc-884b-2f353f31c1f5
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb", "title": "GPT Actions - Snowflake direct", "tokens": 2052, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"0fcdd102-93b8-45bc-884b-2f353f31c1f5\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"88c46207-4331-4ae6-b7d2-a2050372f0ae\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"775ee052d13a93925560fb565cf2c6f1b26b76866b5598edbac5307e876346b1\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5cbdab75-0978-4d07-b52c-6990e6726a60\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_snowflake_direct.ipynb\", \"title\": \"GPT Actions - Snowflake direct\", \"tokens\": 2052, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"8a9064ae405b1e7948814a7f17a651128352f8c7660ffb454a341375486c9fcf\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6978, \"end_char_idx\": 9663, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "ref_doc_id": "88c46207-4331-4ae6-b7d2-a2050372f0ae", "chroma:document": "```python\nCREATE SECURITY INTEGRATION CHATGPT_INTEGRATION\n  TYPE = OAUTH\n  ENABLED = TRUE\n  OAUTH_CLIENT = CUSTOM\n  OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'\n  OAUTH_REDIRECT_URI = 'https://oauth.pstmn.io/v1/callback' --- // this is a temporary value while testing your integration. You will replace this with the value your GPT provides\n  OAUTH_ISSUE_REFRESH_TOKENS = TRUE\n  OAUTH_REFRESH_TOKEN_VALIDITY = 7776000;\n```\n\n\n* Retrieve your OAuth Client ID, Auth URL, and Token URL\n\n\n\n```python\nDESCRIBE SECURITY INTEGRATION CHATGPT_INTEGRATION;\n```\n\n\nYou\u2019ll find the required information in these 3 columns:\n\n\n![../../../images/snowflake_direct_oauth.png](../../../images/snowflake_direct_oauth.png)\n\n\n* Retrieve your OAuth Client Secret\n\nYou\u2019ll find the Client Secret in OAUTH_CLIENT_SECRET.\n\nYou\u2019re now set to test your action in Postman. Once you get a successful API response there, you can proceed with your GPT Action.\n\n### In ChatGPT\n\nIn ChatGPT, click on \"Authentication\" and choose \"OAuth\". Enter in the information below.\n\n* Client ID: use Client ID from steps above\n* Client Secret: use Client Secret from steps above\n* Authorization URL: use Authorization Endpoint from steps above\n* Token URL: use Token Endpoint from steps above\n* Scope: &lt;empty>*\n* Token: Default (POST)\n\n*Snowflake scopes pass the role, but you\u2019ll notice the action itself also specifies the role as a parameter in runQuery, so the Scope is unnecessary. You may elect to pass roles in the scope instead of the action parameters if it makes more sense for your GPT.\n\n### Post-Action Steps\n\n\nOnce you've set up authentication in ChatGPT, follow the steps below in the application to finalize the Action.\n\n* Copy the callback URL from the GPT Action\n* Update the Redirect URI in your Security Integration to the callback URL provided in ChatGPT.\n\n\n\n```python\nALTER SECURITY INTEGRATION CHATGPT_INTEGRATION_DEV SET OAUTH_REDIRECT_URI='https://chat.openai.com/aip/<callback_id>/oauth/callback';\n```\n\n### FAQ & Troubleshooting\n\n\n* _Callback URL Error:_ If you get a callback URL error in ChatGPT, pay close attention to the Post-Action Steps above. You need to add the callback URL directly into your Security Integration for the action to authenticate correctly\n* _Schema calls the wrong warehouse or database:_ If ChatGPT calls the wrong warehouse or database, consider updating your instructions to make it more explicit either (a) which warehouse / database should be called or (b) to require the user provide those exact details before it runs the query\n\n\n\n_Are there integrations that you\u2019d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we\u2019ll take a look._"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 9369a343-f9d5-4af9-b68a-2dc4488f67ee
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"9369a343-f9d5-4af9-b68a-2dc4488f67ee\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a0d3d013-bbf4-4f67-8a3f-cfcec993e022\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"898d832dfb7ed3984707f24561544b2d36430c6dbbffd7393e30e759d050eb9c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3289, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "# GPT Action Library: AWS RedShift\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Building a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis solution enables a GPT action to retrieve data from Redshift and perform data analysis.It uses AWS Functions, performing every action from AWS ecosystem and network. The middleware (AWS function) will perform the SQL query, wait for its completion and return the data as a file. The code is provided for information purpose only and should be modified to your needs.\n\nThis solution uses the ability to [retrieve files in Actions](https://platform.openai.com/docs/actions/sending-files) and use them as if you had uploaded them directly to a conversation.\n\nThis solution highlight a connection to Redshift serverless, the integration with a provisioned Redshift might differ slighltly to retrieve networks and set-up connection, the overall code and (minimal) integration should be similar.\n\n### Value & Example Business Use Cases\n\n**Value**: Leverage ChatGPT's natural language capabilities to connect to Redshift's DWH.\n\n**Example Use Cases**:\n- Data scientists can connect to tables and run data analyses using ChatGPT's Data Analysis\n- Citizen data users can ask basic questions of their transactional data\n- Users gain more visibility into their data & potential anomalies\n\n## Application Information\n\n### Application Prerequisites\n\nBefore you get started, make sure that:\n- You have access to a Redshift environment\n- You have the rights to deploy AWS function in the same VPC (Virtual Private Network)\n- Your AWS CLI is authenticated\n\n## Middleware Information\n\n### Install required libraries\n- Install AWS CLI, required for AWS SAM ([docs](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions))\n- Install AWS SAM CLI ([docs](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html))\n- Install Python\n- Install yq [docs](https://github.com/mikefarah/yq?tab=readme-ov-file#install)\n\n### Middleware function\n\nTo create a function, follow the steps in the [AWS Middleware Action cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_aws_function).\n\nTo deploy specifically an application that connects to Redshift, use the following code instead of the \"hello-world\" GitHub repository referenced in the Middleware AWS Function cookbook. You can either clone the repository or take the code pasted below and modify it to your needs.\n\n> 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).\n\nTo get the code, you can clone openai-cookbook repository and navigate to the redshift-middleware directory\n\n```\ngit clone https://github.com/pap-openai/redshift-middleware\ncd redshift-middleware\n```"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: a0d3d013-bbf4-4f67-8a3f-cfcec993e022
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"a0d3d013-bbf4-4f67-8a3f-cfcec993e022\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"9369a343-f9d5-4af9-b68a-2dc4488f67ee\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"c3895895d508692e6b8199628e271e1df7dc7caed8a7a6c4fa8c106abdebea8e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"07e0d4a1-761d-4d18-95f3-f14708e698ad\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"fdc0c27013843c96ce6bb635338e92863cf3d28e38a7fc18427be44d726bfc6b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3292, \"end_char_idx\": 6106, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "```python\nimport json\nimport psycopg2\nimport os\nimport base64\nimport tempfile\nimport csv\n\n# Fetch Redshift credentials from environment variables\nhost = os.environ['REDSHIFT_HOST']\nport = os.environ['REDSHIFT_PORT']\nuser = os.environ['REDSHIFT_USER']\npassword = os.environ['REDSHIFT_PASSWORD']\ndatabase = os.environ['REDSHIFT_DB']\n\ndef execute_statement(sql_statement):\n    try:\n        # Establish connection\n        conn = psycopg2.connect(\n            host=host,\n            port=port,\n            user=user,\n            password=password,\n            dbname=database\n        )\n        cur = conn.cursor()\n        cur.execute(sql_statement)\n        conn.commit()\n\n        # Fetch all results\n        if cur.description:\n            columns = [desc[0] for desc in cur.description]\n            result = cur.fetchall()\n        else:\n            columns = []\n            result = []\n\n        cur.close()\n        conn.close()\n        return columns, result\n\n    except Exception as e:\n        raise Exception(f\"Database query failed: {str(e)}\")\n\ndef lambda_handler(event, context):\n    try:\n        data = json.loads(event['body'])\n        sql_statement = data['sql_statement']\n\n        # Execute the statement and fetch results\n        columns, result = execute_statement(sql_statement)\n        \n        # Create a temporary file to save the result as CSV\n        with tempfile.NamedTemporaryFile(delete=False, mode='w', suffix='.csv', newline='') as tmp_file:\n            csv_writer = csv.writer(tmp_file)\n            if columns:\n                csv_writer.writerow(columns)  # Write the header\n            csv_writer.writerows(result)  # Write all rows\n            tmp_file_path = tmp_file.name\n\n        # Read the file and encode its content to base64\n        with open(tmp_file_path, 'rb') as f:\n            file_content = f.read()\n            encoded_content = base64.b64encode(file_content).decode('utf-8')\n\n        response = {\n            'openaiFileResponse': [\n                {\n                    'name': 'query_result.csv',\n                    'mime_type': 'text/csv',\n                    'content': encoded_content\n                }\n            ]\n        }\n\n        return {\n            'statusCode': 200,\n            'headers': {\n                'Content-Type': 'application/json'\n            },\n            'body': json.dumps(response)\n        }\n\n    except Exception as e:\n        return {\n            'statusCode': 500,\n            'body': json.dumps({'error': str(e)})\n        }\n\n```\n\n### Retrieve VPC information\n\nWe will need to connnect our function to Redshift, therefore we need to find the network used by Redshift. You can find this on your Redshift interface the AWS console, under Amazon Redshift Serverless > Workgroup configuration > `your_workgroup` > Data access, or through the CLI:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 07e0d4a1-761d-4d18-95f3-f14708e698ad
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"07e0d4a1-761d-4d18-95f3-f14708e698ad\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a0d3d013-bbf4-4f67-8a3f-cfcec993e022\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"0e9170a0a635a0642a4cbe14c6f366b9b1fd7f3a3a3690f33c9e92421e48eb9c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"e58268ee-d1ce-4f34-8e08-94d46a44186f\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"55353d1f2a170965d6e37f7c180cee53b8f4a0a9a5db309b5832e9ac90121c48\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6109, \"end_char_idx\": 7459, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "```python\naws redshift-serverless get-workgroup --workgroup-name default-workgroup --query 'workgroup.{address: endpoint.address, port: endpoint.port, SecurityGroupIds: securityGroupIds, SubnetIds: subnetIds}'\n```\n\n### Set up AWS function\n\nCopy `env.sample.yaml` to `env.yaml` and replace with the values obtained above. You will need a Redshift user with access to your DB/schema.\n\n```\ncp env.sample.yaml env.yaml\n```\n\nFill in `env.yaml` with the values retrieved by the previous command as well as your credentials to Redshift.\nAlternatively, you can create a file named `env.yaml` manually and fill the following variables:\n```\nRedshiftHost: default-workgroup.xxxxx.{region}.redshift-serverless.amazonaws.com\nRedshiftPort: 5439\nRedshiftUser: username\nRedshiftPassword: password\nRedshiftDb: my-db\nSecurityGroupId: sg-xx\nSubnetId1: subnet-xx\nSubnetId2: subnet-xx\nSubnetId3: subnet-xx\nSubnetId4: subnet-xx\nSubnetId5: subnet-xx\nSubnetId6: subnet-xx\n```\n\nThis file will be used to deploy your function with parameters, as shown below:\n\n```\nPARAM_FILE=\"env.yaml\"\nPARAMS=$(yq eval -o=json $PARAM_FILE | jq -r 'to_entries | map(\"\\(.key)=\\(.value|tostring)\") | join(\" \")')\nsam deploy --template-file template.yaml --stack-name redshift-middleware --capabilities CAPABILITY_IAM --parameter-overrides $PARAMS\n```\n\nThe template.yaml has the following content:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: e58268ee-d1ce-4f34-8e08-94d46a44186f
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"e58268ee-d1ce-4f34-8e08-94d46a44186f\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"07e0d4a1-761d-4d18-95f3-f14708e698ad\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"23c2173fdb31f1f6f1cb9a3638d13b9faa7bb4d10f78f63fdf36b192262eba76\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"11ce001c-0dd2-49fe-8edf-015df190d1a8\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"887783962135ba3f2a5ea9e7709688ee6903ada34a8dd762aa49c3c59b372952\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6109, \"end_char_idx\": 9157, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "```python\naws redshift-serverless get-workgroup --workgroup-name default-workgroup --query 'workgroup.{address: endpoint.address, port: endpoint.port, SecurityGroupIds: securityGroupIds, SubnetIds: subnetIds}'\n```\n\n### Set up AWS function\n\nCopy `env.sample.yaml` to `env.yaml` and replace with the values obtained above. You will need a Redshift user with access to your DB/schema.\n\n```\ncp env.sample.yaml env.yaml\n```\n\nFill in `env.yaml` with the values retrieved by the previous command as well as your credentials to Redshift.\nAlternatively, you can create a file named `env.yaml` manually and fill the following variables:\n```\nRedshiftHost: default-workgroup.xxxxx.{region}.redshift-serverless.amazonaws.com\nRedshiftPort: 5439\nRedshiftUser: username\nRedshiftPassword: password\nRedshiftDb: my-db\nSecurityGroupId: sg-xx\nSubnetId1: subnet-xx\nSubnetId2: subnet-xx\nSubnetId3: subnet-xx\nSubnetId4: subnet-xx\nSubnetId5: subnet-xx\nSubnetId6: subnet-xx\n```\n\nThis file will be used to deploy your function with parameters, as shown below:\n\n```\nPARAM_FILE=\"env.yaml\"\nPARAMS=$(yq eval -o=json $PARAM_FILE | jq -r 'to_entries | map(\"\\(.key)=\\(.value|tostring)\") | join(\" \")')\nsam deploy --template-file template.yaml --stack-name redshift-middleware --capabilities CAPABILITY_IAM --parameter-overrides $PARAMS\n```\n\nThe template.yaml has the following content:\n\n\n```python\nAWSTemplateFormatVersion: '2010-09-09'\nTransform: AWS::Serverless-2016-10-31\nDescription: >\n  redshift-middleware\n\n  Middleware to fetch RedShift data and return it through HTTP as files\n\nGlobals:\n  Function:\n    Timeout: 3\n\nParameters:\n  RedshiftHost:\n    Type: String\n  RedshiftPort:\n    Type: String\n  RedshiftUser:\n    Type: String\n  RedshiftPassword:\n    Type: String\n  RedshiftDb:\n    Type: String\n  SecurityGroupId:\n    Type: String\n  SubnetId1:\n    Type: String\n  SubnetId2:\n    Type: String\n  SubnetId3:\n    Type: String\n  SubnetId4:\n    Type: String\n  SubnetId5:\n    Type: String\n  SubnetId6:\n    Type: String\n  CognitoUserPoolName:\n    Type: String\n    Default: MyCognitoUserPool\n  CognitoUserPoolClientName:\n    Type: String\n    Default: MyCognitoUserPoolClient\n\nResources:\n  MyCognitoUserPool:\n    Type: AWS::Cognito::UserPool\n    Properties:\n      UserPoolName: !Ref CognitoUserPoolName\n      Policies:\n        PasswordPolicy:\n          MinimumLength: 8\n      UsernameAttributes:\n        - email\n      Schema:\n        - AttributeDataType: String\n          Name: email\n          Required: false\n\n  MyCognitoUserPoolClient:\n    Type: AWS::Cognito::UserPoolClient\n    Properties:\n      UserPoolId: !Ref MyCognitoUserPool\n      ClientName: !Ref CognitoUserPoolClientName\n      GenerateSecret: true\n\n  RedshiftMiddlewareApi:\n    Type: AWS::Serverless::Api\n    Properties:\n      StageName: Prod\n      Cors: \"'*'\"\n      Auth:\n        DefaultAuthorizer: MyCognitoAuthorizer\n        Authorizers:\n          MyCognitoAuthorizer:\n            AuthorizationScopes:\n              - openid\n              - email\n              - profile\n            UserPoolArn: !GetAtt MyCognitoUserPool."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 11ce001c-0dd2-49fe-8edf-015df190d1a8
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"11ce001c-0dd2-49fe-8edf-015df190d1a8\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"e58268ee-d1ce-4f34-8e08-94d46a44186f\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f04e91b04597f8d1d68fe615e74153fb45c24510f2e58a0c3ddd02a93fea3d96\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"6ecc472c-0f4e-4f2a-a1ac-30b0c9a195b6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"0ce4ae435c18bc569ee8398d9b766102fe08de231db645b7bc9446746bf6e680\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 9157, \"end_char_idx\": 11253, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "Arn\n        \n  RedshiftMiddlewareFunction:\n    Type: AWS::Serverless::Function\n    Properties:\n      CodeUri: redshift-middleware/\n      Handler: app.lambda_handler\n      Runtime: python3.11\n      Timeout: 45\n      Architectures:\n        - x86_64\n      Events:\n        SqlStatement:\n          Type: Api\n          Properties:\n            Path: /sql_statement\n            Method: post\n            RestApiId: !Ref RedshiftMiddlewareApi\n      Environment:\n        Variables:\n          REDSHIFT_HOST: !Ref RedshiftHost\n          REDSHIFT_PORT: !Ref RedshiftPort\n          REDSHIFT_USER: !Ref RedshiftUser\n          REDSHIFT_PASSWORD: !Ref RedshiftPassword\n          REDSHIFT_DB: !Ref RedshiftDb\n      VpcConfig:\n        SecurityGroupIds:\n          - !Ref SecurityGroupId\n        SubnetIds:\n          - !Ref SubnetId1\n          - !Ref SubnetId2\n          - !Ref SubnetId3\n          - !Ref SubnetId4\n          - !Ref SubnetId5\n          - !Ref SubnetId6\n\nOutputs:\n  RedshiftMiddlewareApi:\n    Description: \"API Gateway endpoint URL for Prod stage for SQL Statement function\"\n    Value: !Sub \"https://${RedshiftMiddlewareApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/sql_statement/\"\n  RedshiftMiddlewareFunction:\n    Description: \"SQL Statement Lambda Function ARN\"\n    Value: !GetAtt RedshiftMiddlewareFunction.Arn\n  RedshiftMiddlewareFunctionIamRole:\n    Description: \"Implicit IAM Role created for SQL Statement function\"\n    Value: !GetAtt RedshiftMiddlewareFunctionRole.Arn\n  CognitoUserPoolArn:\n    Description: \"ARN of the Cognito User Pool\"\n    Value: !GetAtt MyCognitoUserPool.Arn\n\n```\n\nRetrieve the URL information from the previous command output, you can then run a cURL request, which should return data in a file format:\n\n\n```python\ncurl -X POST https://<your_url>/Prod/sql_statement/ \\\n-H \"Content-Type: application/json\" \\\n-d '{ \"sql_statement\": \"SELECT * FROM customers LIMIT 10\", \"workgroup_name\": \"default-workgroup\", \"database_name\": \"pap-db\" }'\n```\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 6ecc472c-0f4e-4f2a-a1ac-30b0c9a195b6
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"6ecc472c-0f4e-4f2a-a1ac-30b0c9a195b6\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"11ce001c-0dd2-49fe-8edf-015df190d1a8\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"36061ac237b13eaadc7a824dc3a87005f13a353701e002d21a0e9487310ba4ec\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"fef4760b-47fa-46d9-bc4f-898ab3c0155d\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"97af33b11de264f9c5a986c42d5fb6c6218f51bb31f4ba1825fc1e0a4460a04f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10275, \"end_char_idx\": 13333, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "execute-api.${AWS::Region}.amazonaws.com/Prod/sql_statement/\"\n  RedshiftMiddlewareFunction:\n    Description: \"SQL Statement Lambda Function ARN\"\n    Value: !GetAtt RedshiftMiddlewareFunction.Arn\n  RedshiftMiddlewareFunctionIamRole:\n    Description: \"Implicit IAM Role created for SQL Statement function\"\n    Value: !GetAtt RedshiftMiddlewareFunctionRole.Arn\n  CognitoUserPoolArn:\n    Description: \"ARN of the Cognito User Pool\"\n    Value: !GetAtt MyCognitoUserPool.Arn\n\n```\n\nRetrieve the URL information from the previous command output, you can then run a cURL request, which should return data in a file format:\n\n\n```python\ncurl -X POST https://<your_url>/Prod/sql_statement/ \\\n-H \"Content-Type: application/json\" \\\n-d '{ \"sql_statement\": \"SELECT * FROM customers LIMIT 10\", \"workgroup_name\": \"default-workgroup\", \"database_name\": \"pap-db\" }'\n```\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel.\n\n\n```python\n**Context**: You are an expert at writing Redshift SQL queries. You will initially retrieve the table schema that you will use thoroughly. Every attributes, table names or data type will be known by you.\n\n**Instructions**:\n1. No matter the user's question, start by running `runQuery` operation using this query: \"SELECT table_name, column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'public' ORDER BY table_name, ordinal_position;\"  It will help you understand how to query the data. A CSV will be returned with all the attributes and their table. Make sure to read it fully and understand all available tables & their attributes before querying. You don't have to show this to the user.\n2. Convert the user's question into a SQL statement that leverages the step above and run the `runQuery` operation on that SQL statement to confirm the query works. Let the user know which table you will use/query.\n3. Execute the query and show him the data. Show only the first few rows.\n\n**Additional Notes**: If the user says \"Let's get started\", explain they can ask a question they want answered about data that we have access to. If the user has no ideas, suggest that we have transactions data they can query - ask if they want you to query that.\n**Important**: Never make up a table name or table attribute. If you don't know, go back to the data you've retrieved to check what is available. If you think no table or attribute is available, then tell the user you can't perform this query for them.\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel.\n\nThis expects a response that matches the file retrieval structure in our doc [here](https://platform.openai.com/docs/actions/sending-files) and passes in a `query` as a parameter to execute.\n\nMake sure to follow the steps in the [AWS Middleware cookbook](https://cookbook.openai.com/examples/chatgpt/gpt_actions_library/gpt_middleware_aws_function) to set up authentication.\n\n> Make sure to switch the function app name based on your function deployment."}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: fef4760b-47fa-46d9-bc4f-898ab3c0155d
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb", "title": "GPT Action Library: AWS RedShift", "tokens": 3481, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"fef4760b-47fa-46d9-bc4f-898ab3c0155d\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b59e8cf1-6103-4849-8c27-8fa6c32e3559\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"f62fa967f68bc5241a086fbaa9f3d46980603c7b1353007b2671a89a11a46c3d\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"6ecc472c-0f4e-4f2a-a1ac-30b0c9a195b6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_redshift.ipynb\", \"title\": \"GPT Action Library: AWS RedShift\", \"tokens\": 3481, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"8b6d4b3381c257e67bd605366be2644c9190b0e0a134fa38a6ae96f1b45d6f7f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 13336, \"end_char_idx\": 15784, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "ref_doc_id": "b59e8cf1-6103-4849-8c27-8fa6c32e3559", "chroma:document": "```python\nopenapi: 3.1.0\ninfo:\n  title: SQL Execution API\n  description: API to execute SQL statements and return results as a file.\n  version: 1.0.0\nservers:\n  - url: {your_function_url}/Prod\n    description: Production server\npaths:\n  /sql_statement:\n    post:\n      operationId: executeSqlStatement\n      summary: Executes a SQL statement and returns the result as a file.\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                sql_statement:\n                  type: string\n                  description: The SQL statement to execute.\n                  example: SELECT * FROM customers LIMIT 10\n              required:\n                - sql_statement\n      responses:\n        '200':\n          description: The SQL query result as a JSON file.\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  openaiFileResponse:\n                    type: array\n                    items:\n                      type: object\n                      properties:\n                        name:\n                          type: string\n                          description: The name of the file.\n                          example: query_result.json\n                        mime_type:\n                          type: string\n                          description: The MIME type of the file.\n                          example: application/json\n                        content:\n                          type: string\n                          description: The base64 encoded content of the file.\n                          format: byte\n                          example: eyJrZXkiOiJ2YWx1ZSJ9\n        '500':\n          description: Error response\n          content:\n            application/json:\n              schema:\n                type: object\n                properties:\n                  error:\n                    type: string\n                    description: Error message.\n                    example: Database query failed error details\n\n```\n\n## Conclusion\n\nYou now have deployed a GPT that uses a middleware in AWS, in an authenticated manner, that's able to connect to Redsfhit. Users with access (that are in Cognito) can now query your databases to perform data analysis task:\n\n![../../../images/redshift_gpt.png](../../../images/redshift_gpt.png)"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 4f738aed-025e-4fa6-8a00-ae3c2d0575d6
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"4f738aed-025e-4fa6-8a00-ae3c2d0575d6\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"88cf31ad-bc5b-4182-ac2d-46de4c92fcd0\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b6afc9f6eeff315579f086f30055e8e7d2391e2b89f79446e7e193156d033725\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3570, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "# GPT Action Library: Canvas LMS\n\n## Introduction\n\nThis page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n- [Introduction to GPT Actions Library](https://platform.openai.com/docs/actions/actions-library)\n- [Example of Buliding a GPT Action from Scratch](https://platform.openai.com/docs/actions/getting-started)\n\nThis particular GPT Action provides an overview of how to connect to [Canvas](https://www.instructure.com/canvas), a widely used LMS tool for course material, grading and general education purposes. \n\n### Value + Example Business Use Cases\n\n**Value**: Users can now leverage ChatGPT's natural language capability to connect directly to Canvas\n\n**Example Use Cases**:\n- Query content from LMS \n- Build quizzes\n- Create new modules\n- Understand topics from assigned courses\n\n## Application Information\n\n### Application Key Links\n\nCheck out these links from the application before you get started:\n- Application Website: https://canvas.instructure.com/login/canvas \n- Application API Documentation: https://canvas.instructure.com/doc/api/\n \n\n### Application Prerequisites\n\nBefore you get started, make sure you go through the following steps in your application environment:\n- Ensure you have the access and permissions in Canvas to create an approved integration with an Access Token for testing\n- For OAuth connection see here : https://canvas.instructure.com/doc/api/file.oauth.html\n\n\n![gptactions_canvaslms_approvedintegrations.png](../../../images/gptactions_canvaslms_approvedintegrations.png)\n\n\n## ChatGPT Steps\n\n### Custom GPT Instructions \n\nOnce you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\n**Context** : You are a helpful friendly university level course helper designed to search across canvas courses to help students and educators, this GPT is intended to help students and teachers understand course material, take quiz's and tests from information stored in canvas.  \n\n\n**Instructions**\nWhen asked to perform a task, use the available actions via the canvas.infrastructure.com API\n\n\nYou should be professional and verbose with answers, provide clear pedagogical experience for users. \n\n\nOffer assistance with tasks around summarizing course material, understanding module and quiz information. \n\n\nAsk for clarification when needed to ensure accuracy and completeness in fulfilling user requests. It should also respect user privacy and handle all data securely.\n\n\nIf a user uploads a file, help the user analyze the file before callin the canvas API.\n\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Canvas LMS API\n  description: >\n    This is the API of the Canvas LMS, providing access to various resources such as accounts, courses, users,\n    assignments, quizzes, files, and more.\n  version: 1.0.0\nservers:\n  - url: https://canvas.instructure.com\n    description: Canvas LMS Production Server\npaths:\n  /api/v1/accounts:\n    get:\n      summary: List accounts\n      operationId:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 88cf31ad-bc5b-4182-ac2d-46de4c92fcd0
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"88cf31ad-bc5b-4182-ac2d-46de4c92fcd0\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"4f738aed-025e-4fa6-8a00-ae3c2d0575d6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"10cf94b47576347f64d56c44232b64edf9ce46fed0af52520aed0d082bc0c353\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"3019a95f-6601-4c8c-9c16-6a307106c457\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"8f7ad2cf854720b6866d86498ff64a56dd6c3e402b58ce71053dafedfeb5d2ee\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2015, \"end_char_idx\": 4439, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "```python\n**Context** : You are a helpful friendly university level course helper designed to search across canvas courses to help students and educators, this GPT is intended to help students and teachers understand course material, take quiz's and tests from information stored in canvas.  \n\n\n**Instructions**\nWhen asked to perform a task, use the available actions via the canvas.infrastructure.com API\n\n\nYou should be professional and verbose with answers, provide clear pedagogical experience for users. \n\n\nOffer assistance with tasks around summarizing course material, understanding module and quiz information. \n\n\nAsk for clarification when needed to ensure accuracy and completeness in fulfilling user requests. It should also respect user privacy and handle all data securely.\n\n\nIf a user uploads a file, help the user analyze the file before callin the canvas API.\n\n```\n\n### OpenAPI Schema \n\nOnce you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n\n\n```python\nopenapi: 3.1.0\ninfo:\n  title: Canvas LMS API\n  description: >\n    This is the API of the Canvas LMS, providing access to various resources such as accounts, courses, users,\n    assignments, quizzes, files, and more.\n  version: 1.0.0\nservers:\n  - url: https://canvas.instructure.com\n    description: Canvas LMS Production Server\npaths:\n  /api/v1/accounts:\n    get:\n      summary: List accounts\n      operationId: listAccounts\n      responses:\n        \"200\":\n          description: A paginated list of accounts\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Account\"\n  /api/v1/accounts/{account_id}:\n    get:\n      summary: Get a single account\n      operationId: getAccount\n      parameters:\n        - name: account_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Account details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Account\"\n  /api/v1/courses:\n    get:\n      summary: List courses\n      operationId: listCourses\n      responses:\n        \"200\":\n          description: A paginated list"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 3019a95f-6601-4c8c-9c16-6a307106c457
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"3019a95f-6601-4c8c-9c16-6a307106c457\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"88cf31ad-bc5b-4182-ac2d-46de4c92fcd0\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3b43e0b8d996cef17dab1ee449b055ceabb007417731b84763e52c5de5e1b8d6\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a70cdc86-c711-4099-a10f-c989fd98d293\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"1699ee8c932e1fe51530e65a952947fb6a694dd0432f874fffc4e8791dbfee18\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3609, \"end_char_idx\": 5192, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "\"200\":\n          description: A paginated list of accounts\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Account\"\n  /api/v1/accounts/{account_id}:\n    get:\n      summary: Get a single account\n      operationId: getAccount\n      parameters:\n        - name: account_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Account details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Account\"\n  /api/v1/courses:\n    get:\n      summary: List courses\n      operationId: listCourses\n      responses:\n        \"200\":\n          description: A paginated list of courses\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Course\"\n  /api/v1/courses/{course_id}:\n    get:\n      summary: Get a single course\n      operationId: getCourse\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Course details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Course\"\n  /api/v1/courses/{course_id}/assignments:\n    get:\n      summary: List assignments\n      operationId: listAssignments\n      parameters:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: a70cdc86-c711-4099-a10f-c989fd98d293
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"a70cdc86-c711-4099-a10f-c989fd98d293\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"3019a95f-6601-4c8c-9c16-6a307106c457\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"436e4270ccecc505e22f6c8841a73c79c7a223381a6c41201f33851454f26fba\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"c0dbc8da-3aa4-41b7-92bc-d52e0e0d4bd2\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b3c2541a0ef9224c7da301064ff21ea8ff287ea5a7ea1137202392841ee4fd08\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4374, \"end_char_idx\": 5937, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "responses:\n        \"200\":\n          description: A paginated list of courses\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Course\"\n  /api/v1/courses/{course_id}:\n    get:\n      summary: Get a single course\n      operationId: getCourse\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Course details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Course\"\n  /api/v1/courses/{course_id}/assignments:\n    get:\n      summary: List assignments\n      operationId: listAssignments\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: A paginated list of assignments\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Assignment\"\n  /api/v1/courses/{course_id}/assignments/{assignment_id}:\n    get:\n      summary: Get a single assignment\n      operationId: getAssignment\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n        - name: assignment_id\n          in: path\n          required: true\n          schema:"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: c0dbc8da-3aa4-41b7-92bc-d52e0e0d4bd2
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"c0dbc8da-3aa4-41b7-92bc-d52e0e0d4bd2\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a70cdc86-c711-4099-a10f-c989fd98d293\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3186f5acb68c4617f1ccd286b5c7f67a3f89f12ba41e36e3cec32c0440ef9fb1\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"42116c30-f2de-448c-af3a-e80043b97072\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"790eac1f0947e78ac163e910bfcfb0b6fdac4cee2bed9c05def4ec8dd03b0adc\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5114, \"end_char_idx\": 6660, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "summary: List assignments\n      operationId: listAssignments\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: A paginated list of assignments\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Assignment\"\n  /api/v1/courses/{course_id}/assignments/{assignment_id}:\n    get:\n      summary: Get a single assignment\n      operationId: getAssignment\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n        - name: assignment_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Assignment details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Assignment\"\n  /api/v1/courses/{course_id}/quizzes:\n    get:\n      summary: List quizzes\n      operationId: listQuizzes\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: A paginated list of quizzes\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Quiz\""}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 42116c30-f2de-448c-af3a-e80043b97072
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"42116c30-f2de-448c-af3a-e80043b97072\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"c0dbc8da-3aa4-41b7-92bc-d52e0e0d4bd2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"b937c411d0f4a7150a81aea303f311522809c060634982711993363aed077089\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"6b43381c-2af6-4e99-8940-7644a60bea70\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"5f18597081ca8b34e0a30d0e79295c780a2603cc6f593e8f2d3fa23ed65d217b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5886, \"end_char_idx\": 7420, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Assignment details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Assignment\"\n  /api/v1/courses/{course_id}/quizzes:\n    get:\n      summary: List quizzes\n      operationId: listQuizzes\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: A paginated list of quizzes\n          content:\n            application/json:\n              schema:\n                type: array\n                items:\n                  $ref: \"#/components/schemas/Quiz\"\n  /api/v1/courses/{course_id}/quizzes/{quiz_id}:\n    get:\n      summary: Get a single quiz\n      operationId: getQuiz\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n        - name: quiz_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Quiz details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Quiz\"\n  /api/v1/courses/{course_id}/students/{student_id}/grades:\n     get:\n       summary: List grades for a student\n       operationId: listGrades\n       parameters:\n         - name: course_id\n           in: path"}


created_at: 2024-08-26 20:31:29
topic: persistent://default/default/47f0afae-77ee-4e4a-bcd4-0b050f4de62c
id: 6b43381c-2af6-4e99-8940-7644a60bea70
encoding: FLOAT32
metadata:
{"url": "https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb", "title": "GPT Action Library: Canvas LMS", "tokens": 3428, "retrieve_doc": true, "source": "openai_cookbooks", "_node_content": "{\"id_\": \"6b43381c-2af6-4e99-8940-7644a60bea70\", \"embedding\": null, \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"b855db84-51ad-43d4-9f4f-eb9bbd7b340b\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"94c0725c1d416af6c12c1420e12861595a263bf4f35c0fce50278483aa102078\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"42116c30-f2de-448c-af3a-e80043b97072\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://github.com/openai/openai-cookbook/blob/main/examples/chatgpt/gpt_actions_library/gpt_action_canvaslms.ipynb\", \"title\": \"GPT Action Library: Canvas LMS\", \"tokens\": 3428, \"retrieve_doc\": true, \"source\": \"openai_cookbooks\"}, \"hash\": \"3aa2832d584b5c7691aefe074055f1b03b3268812721d57ba8c25f2453353bc6\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"141d3b8c-d3ab-4693-97df-990b39e36e6a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"c42e6bf7ec31646ea9b259c219f63ba525fbf4c7b208ed16c9f46010d34b7b01\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6602, \"end_char_idx\": 8132, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "ref_doc_id": "b855db84-51ad-43d4-9f4f-eb9bbd7b340b", "chroma:document": "items:\n                  $ref: \"#/components/schemas/Quiz\"\n  /api/v1/courses/{course_id}/quizzes/{quiz_id}:\n    get:\n      summary: Get a single quiz\n      operationId: getQuiz\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:\n            type: integer\n        - name: quiz_id\n          in: path\n          required: true\n          schema:\n            type: integer\n      responses:\n        \"200\":\n          description: Quiz details\n          content:\n            application/json:\n              schema:\n                $ref: \"#/components/schemas/Quiz\"\n  /api/v1/courses/{course_id}/students/{student_id}/grades:\n     get:\n       summary: List grades for a student\n       operationId: listGrades\n       parameters:\n         - name: course_id\n           in: path\n           required: true\n           schema:\n             type: integer\n         - name: student_id\n           in: path\n           required: true\n           schema:\n             type: integer\n       responses:\n         '200':\n           description: A list of grades for the student\n           content:\n             application/json:\n               schema:\n                 type: array\n                 items:\n                   $ref: '#/components/schemas/Grade'\n  /api/v1/courses/{course_id}/students/{student_id}/grades/{grade_id}:\n    get:\n      summary: Get a single grade\n      operationId: getGrade\n      parameters:\n        - name: course_id\n          in: path\n          required: true\n          schema:"}


