Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
imartinez2 authored Aug 14, 2023
2 parents 17c2202 + 9116afe commit 2d44ef3
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to contribute

If you would like to contribute to the Azure ChatGPT repository there are many ways you can help.
If you would like to contribute to the ChatGPT on Azure solution accelerator repository there are many ways you can help.

## Reporting issues

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ChatGPT has grown explosively in popularity as we all know now. Business users a

However, ChatGPT risks exposing confidential intellectual property. One option is to block corporate access to ChatGPT, but people always find workarounds. This also limits the powerful capabilities of ChatGPT and reduces employee productivity and their work experience.

Azure ChatGPT is our enterprise option. This is the exact same service but offered as your private ChatGPT.
ChatGPT on Azure solution accelerator is our enterprise option. This solution provides similar user experience to ChatGPT but offered as your private ChatGPT.

### Benefits are:

Expand All @@ -16,14 +16,14 @@ Azure ChatGPT is our enterprise option. This is the exact same service but offer

**3. Value:** Deliver added business value with your own internal data sources (plug and play) or use plug-ins to integrate with your internal services (e.g., ServiceNow, etc).

We've built a Solution Accelerator to empower your workforce with Azure ChatGPT.
We've built a Solution Accelerator to empower your workforce with ChatGPT on Azure solution accelerator.

# Getting Started

1. [ Introduction](/docs/1-introduction.md)
1. [Provision Azure Resources](/docs/2-provision-azure-resources.md)
1. [Run Azure ChatGPT from your local machine](/docs/3-run-locally.md)
1. [Deploy Azure ChatGPT to Azure](/docs/4-deployto-azure.md)
1. [Run ChatGPT on Azure solution accelerator from your local machine](/docs/3-run-locally.md)
1. [Deploy ChatGPT on Azure solution accelerator to Azure](/docs/4-deployto-azure.md)
1. [Add identity provider](/docs/5-add-Identity.md)
1. [Chatting with your file](/docs/6-chat-over-file.md)
1. [Environment variables](/docs/7-environment-variables.md)
Expand Down
12 changes: 11 additions & 1 deletion docs/1-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# 👋🏻 Introduction

Azure ChatGPT is built with the following technologies.
ChatGPT on Azure solution accelerator is built with the following technologies.

[Node.js 18](https://nodejs.org/en): an open-source, cross-platform JavaScript runtime environment.

Expand All @@ -19,6 +19,8 @@ Azure ChatGPT is built with the following technologies.

[LangChain JS](https://www.langchain.com/): AI orchestration layer to build intelligent apps

[ai sdk](https://sdk.vercel.ai/docs) Open-source library that simplifies building conversational UI on top Next.js and JavaScript

[Tailwind CSS](https://tailwindcss.com/): is a utility-first CSS framework that provides a series of predefined classes that can be used to style each element by mixing and matching

[shadcn/ui](https://ui.shadcn.com/): re-usable components built using Radix UI and Tailwind CSS.
Expand All @@ -27,6 +29,14 @@ Azure ChatGPT is built with the following technologies.

[Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/): fully managed platform-as-a-service (PaaS) for hosting web applications, REST APIs, and mobile back ends.

### Optional Azure

[Azure Document Intelligence](https://learn.microsoft.com/en-GB/azure/ai-services/document-intelligence/) Microsoft Azure Form Recognizer is an automated data processing system that uses AI and OCR to quickly extract text and structure from documents. We use this service for extracting information from documents.

[Azure Cognitive Search](https://learn.microsoft.com/en-GB/azure/search/) Azure Cognitive Search is an AI-powered platform as a service (PaaS) that helps developers build rich search experiences for applications. We use this service for indexing and retrieving information.

[Azure OpenAI Embeddings](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/embeddings?tabs=console) for embed content extracted from files

![](/images/architecture.png)

[Next](/docs/2-provision-azure-resources.md)
2 changes: 1 addition & 1 deletion docs/2-provision-azure-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Click on the Deploy to Azure button and configure your settings in the Azure Portal as described in the [Environment variables](#-environment-variables) section.

⚠️ Note: This will only create azure resources. Follow the [deploy to Azure section](#-deploy-to-azure---github-actions) to build and deploy Azure ChatGPT.
⚠️ Note: This will only create azure resources. Follow the [deploy to Azure section](#-deploy-to-azure---github-actions) to build and deploy ChatGPT on Azure solution accelerator.

Please see the [section below](#-add-an-identity-provider) for important information about adding authentication to your app.

Expand Down
2 changes: 1 addition & 1 deletion docs/4-deployto-azure.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ☁️ Deploy to Azure - GitHub Actions

The following steps describes how Azure ChatGPT can be deployed to Azure App service using GitHub Actions.
The following steps describes how ChatGPT on Azure solution accelerator can be deployed to Azure App service using GitHub Actions.

# 🧬 Fork the repository

Expand Down
8 changes: 4 additions & 4 deletions docs/5-add-Identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We'll create two GitHub apps: one for testing locally and another for production
3. Fill in the following details

```
Application name: Azure ChatGPT DEV Environment
Application name: ChatGPT on Azure solution accelerator DEV Environment
Homepage URL: http://localhost:3000
Authorization callback URL: http://localhost:3000/api/auth/callback/github
```
Expand All @@ -27,7 +27,7 @@ Authorization callback URL: http://localhost:3000/api/auth/callback/github
3. Fill in the following details

```
Application name: Azure ChatGPT Production
Application name: ChatGPT on Azure solution accelerator Production
Homepage URL: https://YOUR-WEBSITE-NAME.azurewebsites.net
Authorization callback URL: https://YOUR-WEBSITE-NAME.azurewebsites.net/api/auth/callback/github
```
Expand All @@ -49,7 +49,7 @@ Authorization callback URL: https://YOUR-WEBSITE-NAME.azurewebsites.net/api/auth
3. Fill in the following details

```
Application name: Azure ChatGPT DEV Environment
Application name: ChatGPT on Azure solution accelerator DEV Environment
Supported account types: Accounts in this organizational directory only
Redirect URI Platform: Web
Redirect URI: http://localhost:3000/api/auth/callback/azure-ad
Expand All @@ -62,7 +62,7 @@ Redirect URI: http://localhost:3000/api/auth/callback/azure-ad
3. Fill in the following details

```
Application name: Azure ChatGPT Production
Application name: ChatGPT on Azure solution accelerator Production
Supported account types: Accounts in this organizational directory only
Redirect URI Platform: Web
Redirect URI: https://YOUR-WEBSITE-NAME.azurewebsites.net/api/auth/callback/azure-ad
Expand Down
2 changes: 1 addition & 1 deletion docs/7-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Below are the required environment variables, to be added to the Azure Portal or
| AZURE_AD_CLIENT_ID | | The client id specific to the application |
| AZURE_AD_CLIENT_SECRET | | The client secret specific to the application |
| AZURE_AD_TENANT_ID | | The organisation Tenant ID |
| **Azure Cognitive Search is optional for Azure ChatGPT. This is only required for chat over file feature.** |
| **Azure Cognitive Search is optional for ChatGPT on Azure solution accelerator. This is only required for chat over file feature.** |
| AZURE_SEARCH_API_KEY | | API Key of Azure Cognitive search |
| AZURE_SEARCH_NAME | https://AZURE_SEARCH_NAME.search.windows.net | The deployment name of your Azure Cognitive Search |
| AZURE_SEARCH_INDEX_NAME | | The index name with [vector search](https://learn.microsoft.com/en-us/azure/search/vector-search-overview) enabled |
Expand Down
Binary file modified images/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion src/components/chat/chat-row.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
"use client";
import { ChatRole } from "@/features/chat/chat-services/models";
import { cn } from "@/lib/utils";
import { FC } from "react";
import { CheckIcon, ClipboardIcon } from "lucide-react";
import { FC, useState } from "react";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import Typography from "../typography";
import { Avatar, AvatarImage } from "../ui/avatar";
import { Button } from "../ui/button";
import { CodeBlock } from "./code-block";
import { MemoizedReactMarkdown } from "./memoized-react-markdown";

interface ChatRowProps {
name: string;
profilePicture: string;
Expand All @@ -15,6 +19,15 @@ interface ChatRowProps {
}

const ChatRow: FC<ChatRowProps> = (props) => {
const [isIconChecked, setIsIconChecked] = useState(false);
const toggleIcon = () => {
setIsIconChecked((prevState) => !prevState);
};

const handleButtonClick = () => {
toggleIcon();
navigator.clipboard.writeText(props.message);
};
return (
<div
className={cn(
Expand All @@ -31,6 +44,19 @@ const ChatRow: FC<ChatRowProps> = (props) => {
<Typography variant="h5" className="capitalize text-primary">
{props.name}
</Typography>
<Button
variant={"ghost"}
size={"sm"}
title="Copy text"
className="justify-right flex"
onClick={handleButtonClick}
>
{isIconChecked ? (
<CheckIcon size={16} />
) : (
<ClipboardIcon size={16} />
)}
</Button>
</div>
</div>
<div className="py-6">
Expand Down
6 changes: 3 additions & 3 deletions src/features/chat/chat-services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export const transformConversationStyleToTemperature = (
) => {
switch (conversationStyle) {
case "precise":
return 1;
return 0.1;
case "balanced":
return 0.5;
case "creative":
return 0.1;
default:
return 1;
default:
return 0.5;
}
};
2 changes: 1 addition & 1 deletion src/features/theme/customise.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const AI_NAME = "Azure ChatGPT";
export const AI_NAME = "ChatGPT on Azure solution accelerator";

0 comments on commit 2d44ef3

Please sign in to comment.