Azure Open AI
Chat Playground | Completions
This is part of a series of articles called Azure Challenges. You can refer to the Intro Page to understand more about how the challenges work.
This Challenge will execute the following steps:
(1) Create your Azure OpenAI account.
(2) Run OpenAI Studio.
(3) Building and Preparing the Chatbot.
(4) Deploying your chatbot in Azure.
(5) Playground.
(1) Create your Azure OpenAI account.
Our very first step is to create the Open AI resource.
Select Azure AI services and then look for Open AI.
Select Azure OpenAI account and hit + Create.
Add the info about your resource like Resource group, Name, and Pricing Tier, and select Next.
OK! Now you have your OpenAI service created!
(2) Run OpenAI Studio
After you create your OpenAI account, select your OpenAI account and choose the option Go to Azure OpenAI Studio.
Inside the OpenAI Studio.
Select chat and then Create new deployment.
Add the info about your deployment and hit Create.
Now you have your dev environment…
In the system message template choose one of the options (i.e. Shakespeare)
And now you are ready to start using the chatbot! You can start the interaction using the Chat session.
ok?
and now let’s ask more questions!
Now the next step! Let’s train our chatbot using our data! ;-)
(3) Preparing the chatbot
Now let’s select Add your data and then + Add a data source.
We have a couple of options to choose for our data source…
For now, let’s choose URL/web address. You can use the address below, just to run this example.
https://en.wikipedia.org/wiki/FAQ
After you choose the URL/web address add the info below and hit Next.
Select the search type = Keyword
now you can select Save and Close.
The ingestion process is in progress <message>
Now your data is ready to be used by your chatbot.
Let’s give it a try?!?!?!
So far so good.
and now a question in which the answer is not in the database…
OK!
(4) Deploying your chatbot in Azure.
You can choose to deploy to a new web app.
Add the web app info:
After that, you are ready to deploy it!
Wait for the deployment…
There you go! ;-)
(5) Playground
On the left menu select Completions.
Let's try text summarization… select Examples and see all the list.
To start we can use the example Explain a SQL Query. And then select Generate to visualize the result.
The result.
Wow!!! \o/
You can also select the button View Code:
you can also see your Key and Endpoint information…
You can also visualize the source code in different languages:
You can also customize the parameters…
Parameters
Temperature
Controls randomness. Lowering the temperature means that the model produces more repetitive and deterministic responses. Increasing the temperature results in more unexpected or creative responses. Try adjusting temperature or Top P but not both.
Max length (tokens)
Set a limit on the number of tokens per model response. The API supports a maximum of 4096 tokens shared between the prompt (including system message, examples, message history, and user query) and the model’s response. One token is roughly four characters for typical English text.
Top probabilities
Similar to temperature, this controls randomness but uses a different method. Lowering Top P narrows the model’s token selection to likelier tokens. Increasing Top P lets the model choose from tokens with both high and low likelihood. Try adjusting temperature or Top P but not both.
Multi-turn conversations
Select the number of past messages to include in each new API request. This helps give the model context for new user queries. Setting this number to 10 results in five user queries and five system responses.
Stop sequences
Stop sequence make the model end its response at a desired point. The model response ends before the specified sequence, so it won’t contain the stop sequence text. For GPT-35-Turbo, using <|im_end|>
ensures that the model response doesn't generate a follow-up user query. You can include as many as four stop sequences.
More info at:
This is the end of the Challenge#9.
You can go to the Intro Page and start the next Challenge.