From d10c095acf3a7b778ebb84bb9cf5cf486ad92c1b Mon Sep 17 00:00:00 2001 From: thivy Date: Wed, 9 Aug 2023 17:04:36 +1000 Subject: [PATCH 1/2] update chat over doc --- docs/6-chat-over-file.md | 15 ++++++++++++++- src/.env.example | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/6-chat-over-file.md b/docs/6-chat-over-file.md index f8662785..5cd8b637 100644 --- a/docs/6-chat-over-file.md +++ b/docs/6-chat-over-file.md @@ -2,10 +2,23 @@ Users can utilise this functionality to upload their PDF files through the portal and engage in chat discussions related to the content of those files. -Chat with your data utilises the following two Azure Services: +Chat with your data utilises the following Azure Services: 1. [Azure Document Intelligence](https://learn.microsoft.com/en-GB/azure/ai-services/document-intelligence/) for extracting information from documents. 1. [Azure Cognitive Search](https://learn.microsoft.com/en-GB/azure/search/) for indexing and retrieving information. +1. [Azure OpenAI Embeddings](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/embeddings?tabs=console) for embed content extracted from files + +### Azure OpenAI Embeddings + +We use Azure OpenAI Embeddings to convert text to vectors and index it in Azure Cognitive Search. + +update the OpenAI environment variables with the following: + +``` +AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME= +``` + +When deploying to Azure, ensure to update the Azure App service app settings with AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME ### Setup Azure Cognitive Search index and Document Intelligence diff --git a/src/.env.example b/src/.env.example index 52bd2ac1..f9cfe0f0 100644 --- a/src/.env.example +++ b/src/.env.example @@ -6,6 +6,7 @@ AZURE_OPENAI_API_KEY= AZURE_OPENAI_API_INSTANCE_NAME= AZURE_OPENAI_API_DEPLOYMENT_NAME= AZURE_OPENAI_API_VERSION=2023-03-15-preview +AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME= # You must have atleast one of the following auth providers configured AUTH_GITHUB_ID= From da3faa70fd71b5e014919586796efe6eb1f8bf4c Mon Sep 17 00:00:00 2001 From: thivy Date: Thu, 10 Aug 2023 08:27:04 +1000 Subject: [PATCH 2/2] add new chat ui --- src/app/chat/page.tsx | 4 +-- src/features/chat/chat-ui/start-new-chat.tsx | 33 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/features/chat/chat-ui/start-new-chat.tsx diff --git a/src/app/chat/page.tsx b/src/app/chat/page.tsx index 3079a5e5..1b523148 100644 --- a/src/app/chat/page.tsx +++ b/src/app/chat/page.tsx @@ -1,6 +1,6 @@ import { Card } from "@/components/ui/card"; -import { NewChat } from "@/features/chat/chat-menu/new-chat"; import { FindAllChatThreadForCurrentUser } from "@/features/chat/chat-services/chat-thread-service"; +import { StartNewChat } from "@/features/chat/chat-ui/start-new-chat"; import { redirect } from "next/navigation"; export default async function Home() { @@ -11,7 +11,7 @@ export default async function Home() { return ( - + ); } diff --git a/src/features/chat/chat-ui/start-new-chat.tsx b/src/features/chat/chat-ui/start-new-chat.tsx new file mode 100644 index 00000000..17ffb64b --- /dev/null +++ b/src/features/chat/chat-ui/start-new-chat.tsx @@ -0,0 +1,33 @@ +import Typography from "@/components/typography"; +import { Card } from "@/components/ui/card"; +import Image from "next/image"; +import { FC } from "react"; +import { NewChat } from "../chat-menu/new-chat"; + +interface Prop {} + +export const StartNewChat: FC = (props) => { + return ( +
+
+ +
+ + + Azure ChatGPT + +
+

+ Welcome to Azure ChatGPT. You should interact in a friendly manner + with the AI assistant and refrain from participating in any harmful + activities. +

+

You can start a new chat with me by clicking the button below.

+
+
+ +
+
+
+ ); +};