Can ChatGPT work with your enterprise data?

AI, Copilot & ChatGPT at Microsoft
5 Apr 202315:55

Summary

TLDRこのビデオでは、OpenAIのChatGPTモデルをAzureで使用し、企業向けのアプリケーションに組み込む方法を紹介します。プライベートな内部データと情報保護コントロールを尊重しながら、効果的なデータ利用や質問への回答、コンテンツ生成を可能にします。Azure OpenAIサービスとAzure Cognitive Searchを組み合わせて、リトリーバル強化生成を活用し、会話型インタラクションを実現する手法を解説。開発者向けのコード例やセキュリティ機能も詳しく説明されています。GPT-3.5およびGPT-4の活用方法や実例も紹介され、アプリケーションの構築に役立つ情報が満載です。

Takeaways

  • 🌐 OpenAIのChatGPTモデルをAzureで使用して、企業向けのアプリ体験に組み込む方法が紹介されています。これにより、組織のプライベートな内部データとインタラクションが可能で、情報保護のコントロールを尊重しながら使用できます。
  • 🔍 Azure OpenAIサービスが一般提供され、独自のアプリでOpenAIの大きな言語モデルをプログラム的に使用できるようになりました。
  • 💬 ChatGPTは会話スタイルのインタラクションに最適化された新しいモデルで、他にも様々なタスクに使用できます。
  • 📚 ChatGPTは公的なデータでトレーニングされていますが、プロンプトを構築してインストラクションと追加データを組み合わせて応答を生成できます。
  • 🔑 'Retrieval Augmented Generation'というアプローチを使用して、Azure OpenAIサービスとAzure Cognitive Searchを組み合わせて、プライベートな知識をインデックス化し、取得することができます。
  • 📝 Azure Cognitive Searchは、ドキュメントやデータポイントの数百万个から最も関連性の高い情報を検索し、言語モデルに提示して詳細かつインフォーメッドなインタラクションを実現します。
  • 🛡️ 知識はChatGPTモデルの外に保管されており、モデルのトレーニングには使用されません。また、チャットセッションの状態はアプリケーション内に完全に保管されます。
  • 🔄 情報保護の観点から、Azure Cognitive Searchのインデックスにある知識ベースに対してセキュリティとフィルタリングのビルディングブロックを使用してアクセスコントロールを実装できます。
  • 🛠️ サンプルアプリでは、ユーザーエクスペリエンスを構築するためのプロンプトの詳細が公開されており、開発者は応答のスタイルやトーンを簡単に調整できます。
  • 🆕 GPT-3.5 Turboモデルに基づいてのデモンストレーションでしたが、GPT-4でも同様のアプローチが適用可能で、より高度な推論能力と長いプロンプト制限により、いくつかのシナリオでは大幅に向上します。
  • 📚 GitHubのaka.ms/entGPTsearchにあるサンプルアプリを試してみることで、独自の企業グレードのChatGPT対応アプリを構築する手引きが得られます。

Q & A

  • AzureサービスでChatGPTをどのように企業向けアプリケーションに活用できますか?

    -ChatGPTモデルを自社データと組み合わせて、質問に答えたり、コンテンツを生成したりする新しいアプリケーションを構築できます。Azure Cognitive Searchを使用して、ChatGPTモデルが必要なデータにアクセスし、詳細で文脈に即した回答を提供することが可能です。

  • Azure OpenAIサービスとは何ですか?

    -Azure OpenAIサービスは、OpenAIの大規模言語モデルにプログラムでアクセスできるサービスであり、自社のアプリケーションで使用できます。このサービスにより、チャットインタラクションを含むさまざまなタスクを実行することができます。

  • 企業向けアプリケーションでのChatGPTの利点は何ですか?

    -ChatGPTを使用すると、アプリケーションがユーザーのデータと対話し、質問に答えたり、コンテンツを生成したりすることができます。これにより、大量のデータを効果的に利用して新しいタスクを実行する能力が向上します。

  • Retrieval Augmented Generationとは何ですか?

    -Retrieval Augmented Generationは、Azure Cognitive Searchを使用して最も関連性の高い情報を検索し、それをChatGPTモデルに提供することで、詳細で文脈に即した回答を生成するアプローチです。

  • Azure Cognitive Searchを使用する利点は何ですか?

    -Azure Cognitive Searchを使用すると、数百万のドキュメントやデータポイントの中から最も関連性の高い情報を検索し、ChatGPTモデルに提供して詳細で文脈に即した回答を生成することができます。

  • ChatGPTの応答に信頼性を持たせる方法は何ですか?

    -ChatGPTの応答には、使用した情報源を引用するようにします。これにより、ユーザーが生成された応答を検証できるようになります。

  • アプリケーションの対話履歴はどのように管理されますか?

    -対話履歴はアプリケーション内で完全に管理され、保存するかどうかや保存場所は完全にユーザーの選択に任されています。

  • 企業向けアプリケーションでのデータ保護はどのように行われますか?

    -データはAzure Cognitive Searchインデックスに保存されており、ドキュメントレベルの細かなアクセス制御などのセキュリティおよびフィルタリング機能を使用してアクセスを制限することができます。

  • GPT-4のリリースはどのようにこのアプローチに影響を与えますか?

    -GPT-4のリリースにより、一部のシナリオでは性能が向上し、特に高度な推論能力や長いプロンプト長制限の恩恵を受けることができます。

  • 新しい情報を検索に追加するプロセスはどのくらい時間がかかりますか?

    -新しい情報がAzure Cognitive Searchに追加されると、ほぼ瞬時に応答に反映されます。

Outlines

00:00

🤖 エンタープライズグレードのチャットボット開発

この段落では、AzureでOpenAIのChatGPTモデルをエンタープライズグレードのアプリケーションに統合する方法が紹介されています。プライベートデータと情報保護コントロールを尊重しながら、組織の内部データとインタラクトすることができるようになります。MicrosoftのDistinguished Engineer、Pablo Castroが、ChatGPTのプロンプトを分析しながら手動デモンストレーションを行います。Azure OpenAIサービスが一般提供され、独自アプリで使用するためのプログラムアクセスを提供するようになりました。ChatGPTは会話スタイルのインタラクションに最適化されたモデルで、他のタスクにも使用できます。

05:01

🔍 検索とチャットボットの統合デモンストレーション

この段落では、Azure Cognitive SearchとChatGPTを組み合わせた「Retrieval Augmented Generation」というアプローチを使用して、プライベートな知識ベースを活用した詳細なインタラクションを実現する方法が説明されています。検索ステップにより、ChatGPTモデルに関連性の高い情報を提示し、ユーザーのデータに対するインタラクションが可能になります。また、情報保護の観点から、チャットセッションの状態はアプリケーション内にのみ存在し、モデルのトレーニングには使用されません。

10:02

🛠️ アプリ内でのチャットボットの実装例

この段落では、Human Resourcesのウェブアプリケーションを通じて、ChatGPTをアプリに実装する典型的な例が紹介されています。このアプリケーションでは、従業員が雇用に関するトピックについてチャットできるようになっています。具体的な質問に対する回答の生成過程や、回答の信頼性を高めるための出典の引用方法が説明されています。さらに、応答のスタイルやフォーマットをカスタマイズする方法も紹介されています。

15:03

📚 情報保護と新情報の追加

この段落では、情報保護の重要性と、ユーザーがアクセスできる情報のみを表示する方法が説明されています。また、新しい情報やドキュメントを検索インデックスに追加し、ChatGPTがそれらを利用できるように更新するプロセスも紹介されています。コードの背後にあるロジックや、Azureサービスと統合された方法も詳しく説明されています。

🚀 エンタープライズグレードのChatGPTアプリの構築

最後の段落では、エンタープライズグレードのChatGPTアプリを構築するための推奨事項が提供されています。GitHubのサンプルアプリを試すことで、自分のデータでアプリを実行し始めることができます。また、Azure OpenAIサービスやAzure Cognitive Searchの詳細について学ぶためのリンクも提供されています。

Mindmap

Keywords

💡Azure OpenAI Service

Azure OpenAI Serviceは、OpenAIの大規模言語モデルにプログラム的にアクセスできるマイクロソフトのサービスです。企業が自社のアプリケーションでGPTモデルを使用して、組織内のデータとやり取りする際に使用されます。このビデオでは、企業向けアプリケーションでのChatGPTの活用方法について詳しく説明されています。

💡ChatGPT

ChatGPTは、会話スタイルのやり取りに最適化されたOpenAIの言語モデルです。このビデオでは、ChatGPTを使用して企業内のデータと対話し、質問に答えたり、コンテンツを生成したりする方法について解説されています。特に、Retrieval Augmented Generationを使用して、モデルに外部の知識を提供する方法が紹介されています。

💡Retrieval Augmented Generation

Retrieval Augmented Generationは、Azure OpenAI ServiceとAzure Cognitive Searchを組み合わせて、外部の知識を取得し、それを用いてChatGPTの応答を生成するアプローチです。これにより、モデルが公開データだけでなく、企業内の特定の情報に基づいて質問に答えることができます。

💡Azure Cognitive Search

Azure Cognitive Searchは、大量のドキュメントやデータポイントから最も関連性の高い情報を検索するためのマイクロソフトのサービスです。このビデオでは、ChatGPTと組み合わせて使用し、企業内のデータから必要な情報を検索し、それを元に応答を生成する方法が説明されています。

💡プロンプト

プロンプトは、ChatGPTに与える入力で、モデルの応答を誘導するための指示や追加データを含みます。このビデオでは、どのようにプロンプトを構築し、応答を生成するかについて詳しく説明されています。また、プロンプトのスタイルやトーンを変更する方法についても言及されています。

💡エンタープライズグレードアプリケーション

エンタープライズグレードアプリケーションは、大規模な企業向けに設計された高性能なアプリケーションを指します。このビデオでは、ChatGPTを活用して、企業が自社のデータに基づいてインタラクティブなアプリケーションを構築する方法が紹介されています。

💡Cognitive Search

Cognitive Searchは、文書やデータの内容を理解し、最も関連性の高い情報を提供する検索技術です。このビデオでは、ChatGPTと連携して、ユーザーの質問に対して適切な情報を引き出し、応答を生成するプロセスに使用されています。

💡セキュリティとアクセス制御

セキュリティとアクセス制御は、ユーザーが許可された情報のみを閲覧できるようにするための機能です。このビデオでは、Azure Cognitive Searchを使用してドキュメントレベルのアクセス制御を実装する方法が説明されています。

💡ドキュメントのインデックス化

ドキュメントのインデックス化は、検索エンジンがドキュメントを効率的に検索できるようにするためのプロセスです。このビデオでは、企業内の新しい情報をAzure Cognitive Searchに追加し、即座にChatGPTの応答に反映させる方法が紹介されています。

💡カスタマイズ可能なプロンプト

カスタマイズ可能なプロンプトは、応答のスタイルや形式を変更するための設定です。このビデオでは、応答を海賊のような口調にしたり、表形式で情報を整理したりする例が示されています。開発者はこれを使ってユーザー体験を向上させることができます。

Highlights

Introduction to integrating OpenAI's ChatGPT model into Azure for enterprise applications.

Azure OpenAI service is now generally available, providing programmatic access to OpenAI large language models.

ChatGPT support for chat interactions is now available in the Azure service.

Potential applications of ChatGPT in enterprise-grade applications, including interacting with private internal data.

Introduction of 'Retrieval Augmented Generation' approach combining Azure OpenAI service with Azure Cognitive Search.

Demonstration of a sample Human Resources web application using ChatGPT for employee benefit queries.

Importance of making ChatGPT responses trustworthy by citing sources.

Explanation of the 'Retrieve-Then-Read' approach for generating responses using ChatGPT and Cognitive Search.

Introduction of different approaches like 'Read-Retrieve-Read' and 'Read-Decompose-Ask' for ChatGPT interactions.

Ability to tweak prompts for different response styles and formats, including changing the response tone.

Demonstration of dynamic format changes, such as generating responses in tables or summarizing information.

Discussion on information protection and ensuring users only see data they are allowed to access.

Explanation of how new information can be quickly added to the knowledge base and reflected in responses.

Code demonstration showing how ChatGPT prompts evolve with each user interaction.

Availability of the Azure OpenAI Studio Playground for experimenting with ChatGPT prompts interactively.

Comparison of GPT-3.5 Turbo and GPT-4 models in terms of performance and capabilities for enterprise applications.

Recommendations for getting started with building enterprise-grade ChatGPT-enabled apps using provided samples.

Transcripts

play00:00

(soft music)

play00:02

- Today we take a look at how you can bring

play00:04

OpenAI's ChatGPT model in Azure

play00:07

to your own enterprise-grade app experiences,

play00:09

so that you can interact

play00:10

with your organization's private internal data,

play00:13

while respecting the information protection controls

play00:15

that you have in place, and along the way,

play00:17

we'll deconstruct how it all works

play00:19

with a breakdown of ChatGPT prompts.

play00:22

And joining me again on the show to go hands-on with ChatGPT

play00:25

is Microsoft Distinguished Engineer, Pablo Castro.

play00:27

Welcome!

play00:28

- Thanks Jeremy, it's great to be back!

play00:30

- And it's great to have you back on the show.

play00:32

Now before we go hands-on with all the tech,

play00:35

it's worth mentioning

play00:36

that since our last show on the topic,

play00:38

the Azure OpenAI service, it's now generally available.

play00:41

So, this is the service that gives you programmatic access

play00:44

to OpenAI large language models to use with your own apps.

play00:48

The GPT model from OpenAI in the Azure service

play00:51

now adds support for chat interactions.

play00:53

In fact, if you missed our last show with Pablo,

play00:56

it's worth checking out at aka.ms/OpenAIMechanics

play01:00

to learn more about the fundamentals of building prompts

play01:03

that guide the output of the OpenAI models

play01:05

as you build app experiences.

play01:07

Now, ChatGPT is of course

play01:09

one of the fastest adopted technologies in recent years.

play01:12

And at Microsoft, we're in fact integrating OpenAI models

play01:16

with related experiences across the Bing search service,

play01:19

GitHub Copilot for AI generated code,

play01:22

and as recently highlighted,

play01:24

the Microsoft 365 portfolio of apps with Copilot,

play01:28

just to name a few.

play01:29

So Pablo, what potential do you see then

play01:31

in terms of applying ChatGPT

play01:34

to enterprise-grade applications on the Azure service?

play01:37

- Well, it's pretty exciting.

play01:39

We can now build applications

play01:40

that combine the ChatGPT model with your own data.

play01:44

This can transform not only the way we interact with apps

play01:47

but also our ability to effectively use vast amounts of data

play01:50

to answer questions, generate content,

play01:52

or any number of new and emerging tasks.

play01:55

ChatGPT is a new model

play01:57

optimized for conversational-style interaction,

play02:00

though it can be used for other tasks as well.

play02:02

It uses a particular convention and syntax

play02:05

to denote turns between the user

play02:07

and ChatGPT as "assistant" in a conversation.

play02:10

And while it's trained on public data,

play02:12

we can construct prompts that include both instructions

play02:15

and additional data to generate responses.

play02:18

So, imagine taking ChatGPT and applying it to your own data

play02:23

but with precise control over the knowledge base

play02:25

for in-context and relevant responses.

play02:28

We can do that using an approach

play02:30

often called "Retrieval Augmented Generation".

play02:33

In this case, we combine the Azure OpenAI service

play02:36

with Azure Cognitive Search

play02:38

to index and retrieve data of all kinds,

play02:40

knowledge that is private

play02:41

and external to the ChatGPT large language model.

play02:44

The retrieval step in Azure Cognitive Search

play02:47

finds the most relevant pieces of information,

play02:49

even if it's millions of documents or data points

play02:51

and presents the top ranked results to the language model,

play02:55

and this lets you have detailed

play02:56

informed interactions with your data.

play02:58

And because the knowledge

play02:59

lives outside of the ChatGPT model,

play03:02

you're in control of it,

play03:03

and it's not used to train the model.

play03:05

And equally important from an enterprise perspective,

play03:08

any chat session state

play03:09

lives entirely within your application.

play03:12

And whether you keep it or not and where

play03:13

is fully up to you.

play03:15

- Just to clarify, by "private knowledge",

play03:16

we mean only data that exists within your organization

play03:19

or your application's boundary.

play03:21

- That's right, or equally you could be a SaaS vendor

play03:24

that wants to enlighten your application

play03:26

to provide an in-context conversation

play03:29

or content generation experience for your customers

play03:31

by using the data you manage for them.

play03:34

So, you're just using

play03:34

the large language model's understanding

play03:36

and reasoning capabilities

play03:38

and building your own app experience around it.

play03:40

- That makes a lot of sense.

play03:41

So now we've had all the context,

play03:42

so can you show us an example

play03:43

of how this would work in an app?

play03:45

- Sure, we'll walk through a typical app experience

play03:47

that you can build around ChatGPT.

play03:49

I have here a sample Human Resources web application.

play03:53

By the way, we've published the code for this whole app,

play03:56

including the UX, the backend, and the sample data

play04:00

in a public GitHub repo at aka.ms/entGPTsearch

play04:04

for you to try it out

play04:05

or use as a starting point for your own apps

play04:07

once you've watched the show.

play04:10

So, this app lets employees generally chat about topics

play04:13

related to their employment benefits and employee handbook.

play04:17

In this case, I want to ask about healthcare coverage,

play04:20

which can be unique by plan, location, individual, etc.

play04:24

So, I'll type "Does my plan cover annual eye exams?"

play04:29

In the generated response,

play04:30

you will see that not only does ChatGPT

play04:33

use the knowledge necessary to derive a response

play04:36

but as a best practice also cites its sources.

play04:40

That's because a key area we are actively exploring

play04:42

is how do we make responses trustworthy?

play04:46

These models are not perfect,

play04:48

so we see this as a collaboration

play04:50

between the user and the app

play04:52

where the app reads through millions of data points

play04:55

and picks a few to formulate an answer.

play04:58

In this case it showed the source it used for the facts,

play05:01

enabling the user to validate the response generated

play05:03

from the "Benefit Options PDF" source if needed.

play05:07

As I mentioned earlier,

play05:08

we achieve this by coordinating the Azure OpenAI model,

play05:11

Cognitive Search, and how we pre-process the data.

play05:15

Now, I'll type a follow-up question.

play05:17

"How about hearing?"

play05:19

While the question in isolation wouldn't make sense,

play05:22

in the context of the chat history,

play05:23

it can figure out what information it needs to answer.

play05:26

For each response,

play05:27

I can see the preview of the file from the citation.

play05:31

And it also shows all the supported content

play05:33

used to formulate the response.

play05:35

And so, in a way, what we're doing here

play05:37

is we're conditioning ChatGPT

play05:39

to produce source citations in its response,

play05:41

which then helps you to validate them.

play05:44

So, can you explain how then

play05:46

this was able to figure out the response?

play05:48

- Sure, we wrote this app, so it would expose the details

play05:51

of what happens in each turn of the conversation.

play05:55

Let's go back to our follow-up question,

play05:57

"How about hearing?"

play05:59

which, as I mentioned on its own,

play06:01

doesn't present enough context to be answered in isolation.

play06:04

When I click on this light bulb,

play06:06

I can see the process it went through to provide a response.

play06:10

Here we can see that GPT first takes the chat history

play06:13

and the last question to produce a good search query.

play06:16

You can also see the rest of the prompt,

play06:18

including some of the mark up

play06:20

used to tell ChatGPT where turns are.

play06:24

By the way, there's also a new API

play06:26

that has more structure around this,

play06:29

so you don't have to construct the prompts

play06:30

with markup manually.

play06:32

Finally, you can see the "sources" part,

play06:35

which is where we inject

play06:36

the fragments of documents we recalled

play06:38

from the search index.

play06:40

And here's the final prompt we send to ChatGPT

play06:43

to generate a complete response.

play06:46

By the way, here we used the "Retrieve-Then-Read" approach

play06:49

for generating responses.

play06:51

This is an easy-to-understand approach

play06:53

that can be effective in simple cases.

play06:55

That said, we've explored other approaches

play06:58

we include in the app that you can experiment with.

play07:01

For example, "Read-Retrieve-Read"

play07:04

would present the model with a question

play07:06

and a list of tools it could select from,

play07:08

such as "search the knowledge base"

play07:10

or "lookup employee data".

play07:12

So here, it would decide to search the knowledge base

play07:15

to find out more about the healthcare plan,

play07:18

it would see that there are different plans,

play07:19

and so to determine which plan applies,

play07:22

it then would look up the employee information

play07:24

using another tool to finally arrive at an answer.

play07:28

Another approach is what we call "Read-Decompose-Ask"

play07:31

which would follow this

play07:32

"chain-of-thought" style of prompting.

play07:36

This would break down the question

play07:37

into individual steps of the thought process

play07:40

and answer intermediate sub-questions

play07:42

to accumulate partial responses

play07:44

until it arrived at a complete answer

play07:46

that it would be ready to send back to the user.

play07:49

- What I really like about this app sample

play07:50

is it really helps you to deconstruct the fundamentals

play07:53

for building these types of app experiences.

play07:56

To that point though,

play07:57

with the logic included into this template,

play07:59

presumably you can tweak the prompts more, right?

play08:02

- You can.

play08:03

Beyond the user experience,

play08:05

the template lets you easily experiment

play08:08

and configure exactly how responses are generated

play08:11

and channel what a user would expect to see.

play08:13

As a developer, you can include additional instructions

play08:16

using a prompt override.

play08:18

For example, this can influence the tone

play08:20

or style of a response.

play08:22

So, I can change the style of the response.

play08:23

Just for fun, I'll make it to answer like a pirate.

play08:27

I'll copy this question

play08:28

and start a new session using this override

play08:30

and paste the question again.

play08:32

And once the new response is generated,

play08:34

you can see it responds like a pirate might, I guess.

play08:38

In all seriousness, this is very powerful

play08:40

because you can easily adapt the style of response.

play08:43

For example, you might want to format the responses

play08:45

to be more concise for a mobile device or add structure.

play08:49

One of my favorite uses of this

play08:51

is to have it generate a response

play08:52

that can use formatting

play08:54

to better organize the information if requested.

play08:57

I'll paste some text to inject a few more instructions

play09:00

into the prompt to do that.

play09:02

Let me start another chat session and this time,

play09:05

I'll use this suggested question

play09:06

to compare two healthcare plans.

play09:09

You'll see it gives me this long answer at first.

play09:12

And now I can ask it to summarize the response in a table

play09:15

and it gives me this nice table comparing the two plans.

play09:19

These are just a few examples.

play09:21

You could do any number of things,

play09:23

even switching responses

play09:24

to a person's native spoken language on the fly,

play09:27

it's up to you

play09:28

and the application experience you want to create.

play09:30

- So, these stylistic and near real-time format changes

play09:32

are a big part of GPT

play09:35

and can also help make information a lot more accessible.

play09:37

Switching gears though a bit,

play09:39

I know a lot of people are probably wondering

play09:40

how information protection in this case works.

play09:43

So, can we talk about how you might make sure

play09:45

that the information that's surfaced

play09:47

is indeed what that user is allowed to see?

play09:49

- So, since the data of the knowledge base

play09:51

is in an Azure Cognitive Search index,

play09:53

there are a variety of building blocks

play09:55

for security and filtering you can use for access control,

play09:58

like implementing document-level granular access control.

play10:01

So, let's demonstrate this together.

play10:03

In this case, let's say our organization

play10:05

is working on an office move

play10:06

to optimize collaboration between teams.

play10:09

Information about the project

play10:10

is restricted to only those of us involved.

play10:13

I'll type "Is there a move or office space change coming?"

play10:17

And the generated response says, "I don't know."

play10:20

Because there are no documents I can see

play10:21

that talk about this.

play10:22

The information available in the sources

play10:25

does not have an answer.

play10:26

So Jeremy, why don't you try this out on your laptop?

play10:29

- Sounds good!

play10:30

So, here I have actually got the app open on my Surface.

play10:32

I'll go ahead and type in the same question.

play10:34

"Is there a move or office space change coming?"

play10:38

And I can immediately see from the generated response

play10:41

that there is a move indeed happening

play10:42

and it's also cited the source: a plan for the office move

play10:46

that's called "TheShuffleProject.pdf"

play10:48

- Right.

play10:49

So, the information is restricted to those involved for now.

play10:52

I'm not part of it

play10:53

but you're actively part of the project team,

play10:55

so you have access to this information.

play10:57

- Okay, so in this case,

play10:58

you've actually written the solution

play10:59

to make sure that only people can see

play11:00

what they're allowed to see.

play11:02

So, why don't we switch gears again though

play11:04

and talk about the process

play11:05

for adding new information into search.

play11:07

So, how long does something like that take?

play11:10

- Well, let's try it out.

play11:12

This time I'll ask something a little bit more random,

play11:15

like "Can I get scuba gear covered by my benefits?"

play11:19

And you can see,

play11:20

it found documents focused on benefits coverage

play11:22

but says it doesn't have information

play11:24

on scuba gear being covered.

play11:26

I have this script here.

play11:28

And in a real application,

play11:29

this would be an automated process

play11:31

that runs as data changes

play11:33

but here I need to make it happen on the spot.

play11:35

I'm going to manually run this script

play11:37

and add the information on a new benefits plan

play11:40

into our knowledge base.

play11:42

So, now with the new content added,

play11:44

I'll ask the same question again.

play11:46

And you can see with the new knowledge available to it,

play11:49

it generates an updated response.

play11:51

- And just to be clear, we didn't speed anything up

play11:53

in terms of using any Movie Magic.

play11:54

The response actually reflects the change almost instantly

play11:58

after Cognitive Search has access to the new information.

play12:02

So to understand the logic a little bit better,

play12:03

can you show us then the code

play12:05

that's running behind your sample app?

play12:06

- Sure.

play12:07

As part of the sample, we included notebook versions

play12:10

of the interesting parts of the backend.

play12:12

The nice thing about showing this in a notebook

play12:15

is that you can see how the state from a chat session

play12:18

is passed from one prompt to the next.

play12:21

Here we are in the notebook in Visual Studio Code.

play12:25

You can see that everything is wired up to Azure services

play12:28

with the right sources,

play12:29

and managed identities to authenticate.

play12:32

Then it create variables for parts of the prompts.

play12:35

So now, let's run the whole thing to the end

play12:38

for a first conversation turn.

play12:41

And here we can see the output.

play12:43

Now, let's do a second turn

play12:45

but this time we'll do it step by step.

play12:48

First let's check the history

play12:49

and we can see the previous user question

play12:51

and the response from the model.

play12:53

Now I'll update the question in line with

play12:55

"How about hearing?"

play12:57

And it is first sent to GPT

play12:59

to map the history and context and generate a search query.

play13:04

From there it uses cognitive search

play13:06

to run a query and get candidate documents.

play13:09

Next, I'll pull up the content

play13:10

and this was returned from our top search results.

play13:15

And this is really the magic with ChatGPT.

play13:18

We can see the prompt evolves with each interaction.

play13:21

This pattern uses everything to construct a prompt:

play13:24

the user question, the chat history, the search results,

play13:27

all to make one big prompt with instructions.

play13:30

Then in our final step,

play13:32

it calls the Azure OpenAI completion API

play13:35

to get a response based on the entire prompt.

play13:37

You can see that the session history

play13:39

is just kept in memory in this case.

play13:42

The model itself doesn't track it

play13:43

and it's up to your application.

play13:45

You could choose to store it or, like we do here,

play13:48

simply let it go when you close your session.

play13:50

In either case, the session history

play13:52

is not added to the large language model.

play13:55

Now, I showed you some prompt experimentation

play13:58

in the notebook.

play14:00

Now, if you don't want to experiment using the notebook

play14:02

or using the code,

play14:04

you can also use the Azure OpenAI Studio Playground

play14:07

to experiment with ChatGPT prompts interactively.

play14:11

The GPT-3.5 Turbo model has been added to the playground

play14:14

along with a new chat interface

play14:17

and all the configuration parameters.

play14:19

- And by the way, you can watch our entire show

play14:20

at aka.ms/OpenAIMechanics

play14:23

to learn about how to use Azure's OpenAI Studio.

play14:28

Now, you also mentioned that this is based on

play14:29

GPT-3.5 Turbo but with the release of GPT-4,

play14:34

how does change the approaches that we've shown today?

play14:36

- Indeed.

play14:37

We were running the sample on GPT-3.5 today

play14:40

because that's the model

play14:42

that most people will have access to.

play14:44

That said, everything we're discussing here

play14:46

applies to GPT-4 as well

play14:48

where some scenarios will perform similarly

play14:50

and others will work much better,

play14:52

thanks to its advanced reasoning capabilities

play14:55

and a much prompt length limit.

play14:57

- And apparently, it can also even pass the bar exam.

play14:59

So, what else would you recommend then

play15:01

for anyone who's watching who's looking to build out

play15:03

their own enterprise-grade ChatGPT enabled apps?

play15:07

- So first, try out the sample app I demonstrated earlier.

play15:10

You can find it on GitHub at aka.ms/entGPTsearch.

play15:11

You can find it on GitHub at aka.ms/entGPTsearch.

play15:15

The sample has everything you need to get started,

play15:18

including creating the Azure services

play15:19

and even the sample data we used.

play15:22

In just a couple of hours, you can have a version

play15:24

of what I showed you running with your own data.

play15:28

Then, to learn more about the Azure OpenAI service,

play15:31

you can go to aka.ms/azure-openai.

play15:35

And for Azure Cognitive Search, check out aka.ms/azsearch.

play15:40

- Pablo, it's always a pleasure having you on the show.

play15:42

And also, don't forget to subscribe to Microsoft Mechanics,

play15:45

the latest in tech updates.

play15:47

Thanks for watching, we'll see you next time!

play15:49

(soft music)

Rate This

5.0 / 5 (0 votes)

Связанные теги
AzureChatGPT企業向けプライベートデータアプリケーションデータ保護対話型AIマイクロソフトCognitive Search技術デモ
Вам нужно краткое изложение на английском?