|
1 | 1 | [[introduction-installing-ai]] |
2 | 2 |
|
3 | | -= OpenAI or Azure OpenAI Subscriptions |
4 | | - |
5 | | -The Narration microservice needs to access an AI service to generate the text narrating the fight. |
6 | | -You can choose between OpenAI or Azure OpenAI. |
7 | | -Azure OpenAI, or "OpenAI on Azure" is a service that provides REST API access to OpenAI's models, including the GPT-4, GPT-3, Codex and Embeddings series. |
8 | | -The difference between OpenAI and Azure OpenAI is that it runs on Azure global infrastructure, which meets your production needs for critical enterprise security, compliance, and regional availability. |
9 | | - |
10 | | -== OpenAI |
| 3 | += OpenAI |
11 | 4 |
|
12 | 5 | https://openai.com/[OpenAI] is a leading artificial intelligence research organization creating cutting-edge AI technologies. |
13 | 6 | OpenAI offers a range of APIs that enable developers to integrate AI capabilities into their applications. |
14 | | -Some of these APIs include: |
15 | 7 |
|
16 | | -* GPT API: This API provides access to the GPT-3 and 4 language model |
17 | | -* Codex API: This API provides access to the Codex model, which is a language model trained on a dataset of public code |
18 | | -* DALL-E API: This API provides access to the DALL-E model, which is a language model trained on a dataset of text-image pairs |
19 | | - |
20 | | -We will be using the GPT-3 API to generate the text narrating the fight. |
| 8 | +We will be using the GPT API to generate the text narrating the fight. |
21 | 9 |
|
22 | 10 | First, you need to have an OpenAI subscription and then generate an API key. |
23 | | -Then you need to ge the organisation id and key to invoke the API. |
24 | | -To get the organisation id, go to https://platform.openai.com/account/org-settings[OpenAI organisation settings] and copy the organisation id.: |
25 | | - |
26 | | -image::openai-org.png[role=half-size] |
27 | | - |
28 | | -Then, to get the API key, go to https://platform.openai.com/account/api-keys[OpenAI API keys] and copy the API key: |
| 11 | +To get the API key, go to https://platform.openai.com/api-keys[OpenAI API keys] and create a new API key: |
29 | 12 |
|
30 | 13 | image::openai-key.png[role=half-size] |
31 | 14 |
|
32 | | -You will have to https://platform.openai.com/account/billing/overview[credit your OpenAI account] with some money to be able to use the API. |
| 15 | +You will have to https://platform.openai.com/settings/organization/billing/overview[credit your OpenAI account] with some money to be able to use the API. |
33 | 16 |
|
34 | 17 | image::openai-fund.png[role=half-size] |
35 | 18 |
|
36 | | -== Azure OpenAI |
37 | | - |
38 | | -If you already have an Azure subscription, you can use it to create an https://azure.microsoft.com/products/ai-services/openai-service[Azure OpenAI] resource. |
39 | | -Otherwise, you can create a https://azure.microsoft.com/free[free Azure subscription] and use it to create an Azure OpenAI resource. |
40 | | -Then, you need to use the Azure OpenAI service to generate the API key and endpoint URL. |
41 | | -You can either do that using the https://portal.azure.com/[Azure Portal] or the https://learn.microsoft.com/cli/azure/[Azure CLI]. |
42 | | - |
43 | | -The easiest being use the Azure CLI, we recommend that you https://learn.microsoft.com/cli/azure/install-azure-cli[install it] and use it to create the Azure OpenAI resource and generate the API key and endpoint URL. |
44 | | -Once Azure CLI is installed and you have your Azure subscription, sign in to your Azure account: |
45 | | - |
46 | | -[source,shell] |
47 | | ----- |
48 | | -az login |
49 | | ----- |
50 | | - |
51 | | -[NOTE] |
52 | | -==== |
53 | | -If you have several Azure subscription, make sure you are using the right one. |
54 | | -For that, you can execute the following command to list all your subscriptions and set the one you want to use: |
55 | | -
|
56 | | -[source,shell] |
57 | | ----- |
58 | | -az account list --output table |
59 | | -az account set --subscription <subscription-id> |
60 | | -az account show |
61 | | ----- |
62 | | -==== |
63 | | - |
64 | | -Then, execute the following command to create the Azure OpenAI resources: |
65 | | - |
66 | | -[source,bash] |
67 | | ----- |
68 | | -include::{projectdir}/infrastructure/ai-azure-openai-create.sh[tags=adocSetup;!adocSkip] |
69 | | ----- |
70 | | - |
71 | | -This script will create the Azure OpenAI resource and deploy the model. |
72 | | -Once the script has executed, you can use the following command to get the API key and endpoint URL. |
73 | | -You will need these properties later one when you will configure the Narration microservice: |
74 | | - |
75 | | -[source,bash] |
76 | | ----- |
77 | | -include::{projectdir}/infrastructure/ai-azure-openai-create.sh[tag=adocProperties] |
78 | | ----- |
79 | | - |
80 | | -Once you've finished the workshop, remember to delete the Azure OpenAI resources to avoid being charged for it: |
81 | | - |
82 | | -[source,bash] |
83 | | ----- |
84 | | -include::{projectdir}/infrastructure/ai-azure-openai-delete.sh[tag=adocDelete] |
85 | | ----- |
| 19 | +Keep your API key handy — you will need it when configuring the Narration microservice. |
0 commit comments