U盘装系统_分享U盘装系统教程_提供64位win11、win10、win7电脑系统及绿色软件下载

当前位置:首页 > 系统教程 > 安装教程

如何在 Windows 中安装和使用 AI Shell

时间:2025-01-02 来源: 点击:
手机扫码继续观看
如何在 Windows 中安装和使用 AI Shell

  //

  // To use the Azure OpenAI service:

  // - Set `Endpoint` to the endpoint of your Azure OpenAI service,

  // or the endpoint to the Azure API Management service if you are using it as a gateway.

  // - Set `Deployment` to the deployment name of your Azure OpenAI service.

  // - Set `ModelName` to the name of the model used for your deployment, e.g. "gpt-4-0613".

  // - Set `Key` to the access key of your Azure OpenAI service,

  // or the key of the Azure API Management service if you are using it as a gateway.

  // For example:

  {

  "Name": "ps-az-gpt4",

  "Description": "A GPT instance with expertise in PowerShell scripting and command line utilities. Use gpt-4 running in Azure.",

  "Endpoint": "",

  "Deployment": "",

  "ModelName": "", // required field to infer properties of the service, such as token limit.

  "Key": "",

  "SystemPrompt": "1. You are a helpful and friendly assistant with expertise in PowerShell scripting and command line.\n2. Assume user is using the operating system `win` unless otherwise specified.\n3. Use the `code block` syntax in markdown to encapsulate any part in responses that is code, YAML, JSON or XML, but not table.\n4. When encapsulating command line code, use '```powershell' if it's PowerShell command; use '```sh' if it's non-PowerShell CLI command.\n5. When generating CLI commands, never ever break a command into multiple lines. Instead, always list all parameters and arguments of the command on the same line.\n6. Please keep the response concise but to the point. Do not overexplain."

  },

  // To use the public OpenAI service:

  // - Ignore the `Endpoint` and `Deployment` keys.

  // - Set `ModelName` to the name of the model to be used.

  // - Set `Key` to be the OpenAI access token.

  // For example:*/

  {

  "Name": "ps-gpt4o",

  "Description": "A GPT instance with expertise in PowerShell scripting and command line utilities. Use gpt-4o running in OpenAI.",

  "ModelName": "gpt-4o",

  "Key": "",

  "SystemPrompt": "1. You are a helpful and friendly assistant with expertise in PowerShell scripting and command line.\n2. Assume user is using the operating system `Windows 11` unless otherwise specified.\n3. Use the `code block` syntax in markdown to encapsulate any part in responses that is code, YAML, JSON or XML, but not table.\n4. When encapsulating command line code, use '```powershell' if it's PowerShell command; use '```sh' if it's non-PowerShell CLI command.\n5. When generating CLI commands, never ever break a command into multiple lines. Instead, always list all parameters and arguments of the command on the same line.\n6. Please keep the response concise but to the point. Do not overexplain."

  }

  ],

  // Specify the default GPT instance to use for user query.

  // For example: "ps-az-gpt4"

  "Active": null

  }

  然后,在 AI Shell 窗格中键入 /refresh 以应用更改。

  您可以通过在 AI Shell 窗格中键入问题或命令来与 AI Shell 交互。要将命令定向到特定代理,请使用语法 @后跟您的查询。例如,@openai-gpt "How do I list files in a directory?" 会将该问题发送到 Azure OpenAI 代理。代理的初始选择将由您运行命令 Start-AIShell 时的提示符完成.

  AI Shell 提供了多个内置命令和键盘快捷键来加快您的工作流程:

  • 使用 /code post 命令或 Ctrl+d, Ctrl+d 键盘快捷方式将生成的代码插入 PowerShell 会话。

  • 使用 /code copy 命令或 Ctrl+d, Ctrl+c 将生成的代码复制到剪贴板。Ctrl+ 将复制_n th_代码片段。

  • 使用 Alt+RightArrow 和 Alt+LeftArrow 在 AI Shell 和 PowerShell 窗格之间移动光标。

  • 使用 Resolve-Error cmdlet 将错误消息发送到 AI Shell 寻求帮助。

  • 使用 Invoke-AIShell cmdlet 将查询发送到打开的 AI Shell 窗口中当前选定的代理。此命令还允许您通过管道将命令输出传递到 AI 代理以获取更多上下文。

  • 键入 /help 可查看所有可用命令的列表。

  通过使用 /code post 命令,可以轻松地将 AI Shell 生成的代码发布到 PowerShell 会话中。如果需要从 AI Shell 复制所有或某些代码片段以供以后使用,/code copy 命令可用于将生成的代码复制到剪贴板以供以后使用。

  如果您在工作终端中遇到错误,则可以使用 Resolve-Error 命令将该错误发送到 AI Shell 窗口寻求帮助。

  AI Shell 的 Invoke-AIShell 命令允许您将查询发送到当前选定的代理。这可以在有代码或没有代码的情况下完成。

  ________________________________________

  AI Shell 可以使用简单的脚本或手动安装,每种方法都适合不同的用户偏好。该脚本更加用户友好,并自动执行多个步骤,使整个过程更轻松,而手动安装允许对特定配置进行更多控制。凭借其直观的界面和强大的命令集,AI Shell 是任何希望提高生产力的人的绝佳补充。

上一篇:超过十天win11怎么退回win10系统

下一篇:返回列表

相关文章