11---
2- title : OpenAI agent README
3- description : Learn how to use the OpenAI agent in AI Shell .
4- ms.date : 05/21 /2025
2+ title : OpenAI agent
3+ description : Learn how to configure the OpenAI agent.
4+ ms.date : 08/25 /2025
55ms.topic : how-to
66---
77# OpenAI agent
88
9- This agent is designed to provide a user-friendly platform for interacting with OpenAI services. It
10- can connect to a public OpenAI service or a private deployment of the Azure OpenAI service. We
11- recommend using an Azure OpenAI deployment for enhanced security and privacy.
9+ This agent provides a user-friendly platform for interacting with OpenAI services. The OpenAI agent
10+ can connect to a public OpenAI service, a private deployment of the Azure OpenAI service, or any
11+ other OpenAI-compatible service. We recommend using an Azure OpenAI deployment for enhanced security
12+ and privacy.
1213
1314## Prerequisites
1415
15- - For OpenAI, you need the ** Model Name** and ** API Key** to use the agent.
16- - [ OpenAI API Key] [ 09 ]
17- - [ OpenAI Model] [ 10 ]
16+ Before you can use the agent, you must configure at least one GPT instance in the agent
17+ configuration file. Collect the following information about your OpenAI implementation:
1818
19- - For Azure OpenAI Service, you need the ** Endpoint** , ** Deployment Name** , ** Model Name** , and
20- ** API Key** to use the agent.
21- - [ Access to Azure OpenAI] [ 03 ]
22- - [ Create an Azure OpenAI deployment] [ 01 ]
19+ - ` ModelName ` - the name of the AI model to use
20+ - ` Key ` - the API key used to authenticate requests to the OpenAI service
21+ - ` Endpoint ` - required for Azure OpenAI and other 3rd-party services
22+ - ` Deployment ` - the name of your Azure OpenAI deployment
23+
24+ You also need to give your GPT instance a ` Name ` , a ` Description ` , and a ` SystemPrompt ` .
25+
26+ - ` Name ` - identifies the GPT instance in the agent configuration
27+ - ` Description ` - provides additional context about its purpose and capabilities
28+ - ` SystemPrompt ` - defines the behavior and personality of the GPT instance
29+
30+ These values are can be customized to fit your needs.
2331
2432## Configuration
2533
26- Before getting started, you need to configure the agent with the details of your OpenAI
27- implementation. To configure the agent, use the ` /agent config openai-gpt ` command to open
28- configuration file in your default editor .
34+ GPTs are tailored versions of base OpenAI models. You use a GPT to provide focused responses based
35+ on the system prompt you give the model. By changing the system prompt and model, you can create
36+ multiple GPTs for the same endpoint that are tailored for specific domains or scenarios .
2937
30- - Azure OpenAI requires the ` endpoint ` , ` deployment ` name, and the ` model ` name.
31- - Public OpenAI only requires the ` model ` name. No endpoint, no deployment name.
38+ - Azure OpenAI requires the ` Endpoint ` , ` Deployment ` ,` ModelName ` and ` Key ` or ` AuthType ` .
39+ - Public OpenAI only requires the ` ModelName ` and ` Key ` . The endpoint is fixed by OpenAI. There is
40+ no deployment name.
41+ - Other OpenAI-compatible services typically require the ` Endpoint ` , ` ModelName ` , and ` Key ` .
42+
43+ GPTs are configured in the agent's settings file. To open the configuration file using your default
44+ editor, use the ` /agent config openai-gpt ` command.
3245
3346Update the file based on the following example:
3447
@@ -38,11 +51,11 @@ Update the file based on the following example:
3851 " GPTs" : [
3952 // To use the Azure OpenAI service:
4053 // - Set `Endpoint` to the endpoint of your Azure OpenAI service,
41- // or the endpoint to the Azure API Management service if you are using it as a gateway.
54+ // or the endpoint to the Azure API Management service if you are using it as a gateway.
4255 // - Set `Deployment` to the deployment name of your Azure OpenAI service.
4356 // - Set `ModelName` to the name of the model used for your deployment, e.g. "gpt-4-0613".
4457 // - Set `Key` to the access key of your Azure OpenAI service,
45- // or the key of the Azure API Management service if you are using it as a gateway.
58+ // or the key of the Azure API Management service if you are using it as a gateway.
4659 {
4760 " Name" : " ps-az-gpt4" ,
4861 " Description" : " A GPT instance with expertise in PowerShell scripting and command line utilities. Use gpt-4 running in Azure." ,
@@ -72,16 +85,20 @@ Update the file based on the following example:
7285}
7386```
7487
75- > [ !NOTE]
76- > The endpoint for the Azure OpenAI configuration doesn't need a full endpoint including the
77- > deployment, for example you can just use the following endpoint format,
78- > ` https://<YourServiceName>.openai.azure.com ` .
88+ ## ` /gpt ` Command
7989
80- ### Support for Microsoft Entra ID authentication
90+ Use the ` /gpt ` command to list and select the GPT you want to use.
8191
82- To keep password and keys secure, we’ve added support for Entra ID authentication to to Azure OpenAI
83- instances. Now you can access your Azure OpenAI resource without storing keys in the configuration
84- file. The following example shows how to configure Entra ID authentication:
92+ - Run ` /gpt use <gpt-name> ` to switch to another GPT instance, or run ` /gpt use ` to choose from the
93+ available ones.
94+ - Run ` /gpt list <gpt-name> ` to view the details of a GPT definition, or run ` /gpt list ` to list all
95+ available GPTs.
96+
97+ ## Support for Microsoft Entra ID authentication
98+
99+ The OpenAI agent support Entra ID authentication for Azure OpenAI instances. Instead of providing a
100+ key, set the ` AuthType ` property to ` EntraID ` . This way, the agent can access your Azure OpenAI
101+ resource without storing keys in the configuration file.
85102
86103``` json
87104{
@@ -117,63 +134,25 @@ Azure OpenAI uses the following hierarchy of credentials for authentication:
117134- ` InteractiveBrowserCredential `
118135
119136For more information about these credentials, see .NET documentation for
120- [ ` DefaultAzureCredential ` ] [ 11 ] .
121-
122- ## GPT
123-
124- GPTs are tailored versions of base OpenAI models. You use a GPT to provide focused responses based
125- on the system prompt you give the model. GPTs are configured in the agent's settings file. Each GPT
126- configuration includes the name, description, targeted OpenAI model, and system prompt for
127- interaction. The system prompts can be customized to support specific scenarios. Each configuration
128- allows you to create distinct GPTs tailored to a specific domain or scenario. Furthermore, you can
129- select different OpenAI models for each GPT as required.
130-
131- ### Command
132-
133- The command ` /gpt ` is provided to make it easy to manage the GPTs.
134-
135- - Run ` /gpt use <gpt-name> ` to switch to another GPT instance, or run ` /gpt use ` to choose from the
136- available ones.
137- - Run ` /gpt list <gpt-name> ` to view the details of a GPT definition, or run ` /gpt list ` to list all
138- available GPTs.
139-
140- ``` shell
141- aish:1> /gpt --help
142- Description:
143- Command for GPT management within the ' openai-gpt' agent.
144-
145- Usage:
146- gpt [command] [options]
147-
148- Options:
149- -h, --help Show help and usage information
150-
151- Commands:
152- list < GPT> List a specific GPT, or all available GPTs.
153- use < GPT> Specify a GPT to use, or choose one from the available GPTs.
154- ```
137+ [ ` DefaultAzureCredential ` ] [ 07 ] .
155138
156139## Support for other OpenAI-compatible models
157140
158- With the release of AI Shell v1.0.0-preview.2, the ` openai-gpt ` agent extends support to third-party
159- models that follow the OpenAI API specifications, allowing for a more flexible AI experience. Many
160- of these models are open source tools for running SLMs and LLMs locally. The ` openai-gpt ` agent now
161- supports the following models:
141+ The OpenAI agent supports third-party AI services that implement the OpenAI API specifications. Some
142+ of these models are open source tools for running SLMs and LLMs locally. The OpenAI agent supports
143+ the following 3rd-party models:
162144
163- - [ ** Ollama** ] [ 08 ]
164- - [ ** LM Studio** ] [ 06 ]
165- - [ ** Deepseek** ] [ 04 ]
166- - [ ** LocalAI** ] [ 07 ]
167- - [ ** Google Gemini** ] [ 02 ]
168- - [ ** Grok** ] [ 05 ]
145+ - [ ** Ollama** ] [ 06 ]
146+ - [ ** LM Studio** ] [ 04 ]
147+ - [ ** Deepseek** ] [ 02 ]
148+ - [ ** LocalAI** ] [ 05 ]
149+ - [ ** Google Gemini** ] [ 01 ]
150+ - [ ** Grok** ] [ 03 ]
169151
170- To use these models, you only need to configure the ` endpoint ` , ` key ` , and ` model ` name in the agent
171- configuration file. The following ` openai.agents.config ` file contains example configurations for
172- two of the new AI providers. For more information about endpoints and model names, see the
173- documentation for the specific model.
152+ For more information about endpoints and model names, see the 3rd-party documentation for the AI
153+ service you want to use.
174154
175- With the release of AI Shell v1.0.0-preview.4, the ` openai-gpt ` agent supports the following
176- models names:
155+ The OpenAI agent supports the following model names:
177156
178157- ` o1 `
179158- ` o3 `
@@ -184,16 +163,13 @@ models names:
184163- ` gpt-4-32k `
185164- ` gpt-4-turbo `
186165- ` gpt-3.5-turbo `
166+ - ` gpt-35-turbo ` - Azure OpenAI name of the model
187167
188168<!-- link references -->
189- [ 01 ] : /azure/ai-services/openai/how-to/create-resource?pivots=web-portal
190- [ 02 ] : https://ai.google.dev/gemini-api/docs/openai
191- [ 03 ] : https://aka.ms/oai/access?azure-portal=true
192- [ 04 ] : https://api-docs.deepseek.com/
193- [ 05 ] : https://docs.x.ai/docs/overview#migrating-from-another-llm-provider
194- [ 06 ] : https://lmstudio.ai/docs/api/openai-api
195- [ 07 ] : https://localai.io/
196- [ 08 ] : https://ollama.com/blog/openai-compatibility
197- [ 09 ] : https://platform.openai.com/api-keys
198- [ 10 ] : https://platform.openai.com/docs/models
199- [ 11 ] : xref:Azure.Identity.DefaultAzureCredential
169+ [ 01 ] : https://ai.google.dev/gemini-api/docs/openai
170+ [ 02 ] : https://api-docs.deepseek.com/
171+ [ 03 ] : https://docs.x.ai/docs/overview#migrating-from-another-llm-provider
172+ [ 04 ] : https://lmstudio.ai/docs/api/openai-api
173+ [ 05 ] : https://localai.io/
174+ [ 06 ] : https://ollama.com/blog/openai-compatibility
175+ [ 07 ] : xref:Azure.Identity.DefaultAzureCredential
0 commit comments