zh-CN/code365scripts.openai-help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh">
  <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>New-ChatGPTConversation</command:name>
      <command:verb>New</command:verb>
      <command:noun>ChatGPTConversation</command:noun>
      <maml:description>
        <maml:para>创建一个新的 ChatGPT 对话,或者如果您直接指定了 prompt 参数,则获取聊天完成结果。</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>创建一个新的 ChatGPT 对话,您可以像与人聊天一样与 OpenAI 服务聊天。 如果您指定了 prompt 参数,您也可以获得聊天完成结果。</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>New-ChatGPTConversation</maml:name>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="1" aliases="none">
          <maml:name>prompt</maml:name>
          <maml:description>
            <maml:para>如果您希望立即获得结果,您可以使用此参数定义提示。 它不会启动聊天对话。 如果您提供一个文件路径到这个参数,我们将读取文件作为提示。 您也可以为此参数指定一个 URL,我们将读取 URL 作为提示。 您可以通过使用 "lib:xxxxx" 作为提示从库 (https://github.com/code365opensource/promptlibrary) 读取提示,例如,"lib:fitness"。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="token, access_token, accesstoken, key, apikey">
          <maml:name>api_key</maml:name>
          <maml:description>
            <maml:para>用于访问 OpenAI Service 的 API 密钥,如果未指定,将从环境变量 OPENAI_API_KEY 中读取。 您也可以使用 "token"、"access_token" 或 "accesstoken" 作为别名。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="engine, deployment">
          <maml:name>model</maml:name>
          <maml:description>
            <maml:para>用于此请求的模型,您也可以在环境变量 OPENAI_API_MODEL 中设置。 如果您使用的是 Azure OpenAI Service,则模型应是您在门户中创建的部署名称。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>endpoint</maml:name>
          <maml:description>
            <maml:para>用于此请求的端点,您也可以在环境变量 OPENAI_API_ENDPOINT 中设置。 您还可以使用一些特殊值来指定端点,如 "ollama", "local", "kimi", "zhipu"。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>system</maml:name>
          <maml:description>
            <maml:para>系统提示,这是一个字符串,您可以使用它定义您希望它扮演的角色,例如,"You are a chatbot, please answer the user's question according to the user's language." 如果您提供一个文件路径到这个参数,我们将读取文件作为系统提示。 您也可以为此参数指定一个 URL,我们将读取 URL 作为系统提示。 您可以通过使用 "lib:xxxxx" 作为提示从库 (https://github.com/code365opensource/promptlibrary) 读取提示,例如,"lib:fitness"。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>You are a chatbot, please answer the user's question according to the user's language.</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="settings">
          <maml:name>config</maml:name>
          <maml:description>
            <maml:para>API 调用的动态设置,它可以满足每个模型的所有要求。 请传递一个自定义对象到这个参数,如 @{temperature=1;max_tokens=1024}。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
          <dev:type>
            <maml:name>PSObject</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="out">
          <maml:name>outFile</maml:name>
          <maml:description>
            <maml:para>如果您希望将结果保存到文件中,您可以使用此参数设置文件路径。 您也可以使用 "out" 作为别名。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>json</maml:name>
          <maml:description>
            <maml:para>以 json 格式发送响应。</maml:para>
          </maml:description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="variables">
          <maml:name>context</maml:name>
          <maml:description>
            <maml:para>如果您希望将一些动态值传递给提示,您可以在这里使用 context 参数。 它可以是任何东西,您只需在这里指定一个自定义的 PowerShell 对象。 您可以通过使用 {{you_variable_name}} 语法在系统提示或用户提示中定义变量,然后将数据传递给 context 参数,如 @{you_variable_name="your value"}。 如果有多个变量,您可以使用 @{variable1="value1";variable2="value2"}。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
          <dev:type>
            <maml:name>PSObject</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>headers</maml:name>
          <maml:description>
            <maml:para>如果您希望将一些自定义头传递到 API 调用,您可以使用此参数。 您可以传递一个自定义的哈希表给这个参数,如 @{header1="value1";header2="value2"}。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
          <dev:type>
            <maml:name>PSObject</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="token, access_token, accesstoken, key, apikey">
        <maml:name>api_key</maml:name>
        <maml:description>
          <maml:para>用于访问 OpenAI Service 的 API 密钥,如果未指定,将从环境变量 OPENAI_API_KEY 中读取。 您也可以使用 "token"、"access_token" 或 "accesstoken" 作为别名。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="engine, deployment">
        <maml:name>model</maml:name>
        <maml:description>
          <maml:para>用于此请求的模型,您也可以在环境变量 OPENAI_API_MODEL 中设置。 如果您使用的是 Azure OpenAI Service,则模型应是您在门户中创建的部署名称。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>endpoint</maml:name>
        <maml:description>
          <maml:para>用于此请求的端点,您也可以在环境变量 OPENAI_API_ENDPOINT 中设置。 您还可以使用一些特殊值来指定端点,如 "ollama", "local", "kimi", "zhipu"。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>system</maml:name>
        <maml:description>
          <maml:para>系统提示,这是一个字符串,您可以使用它定义您希望它扮演的角色,例如,"You are a chatbot, please answer the user's question according to the user's language." 如果您提供一个文件路径到这个参数,我们将读取文件作为系统提示。 您也可以为此参数指定一个 URL,我们将读取 URL 作为系统提示。 您可以通过使用 "lib:xxxxx" 作为提示从库 (https://github.com/code365opensource/promptlibrary) 读取提示,例如,"lib:fitness"。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>You are a chatbot, please answer the user's question according to the user's language.</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="1" aliases="none">
        <maml:name>prompt</maml:name>
        <maml:description>
          <maml:para>如果您希望立即获得结果,您可以使用此参数定义提示。 它不会启动聊天对话。 如果您提供一个文件路径到这个参数,我们将读取文件作为提示。 您也可以为此参数指定一个 URL,我们将读取 URL 作为提示。 您可以通过使用 "lib:xxxxx" 作为提示从库 (https://github.com/code365opensource/promptlibrary) 读取提示,例如,"lib:fitness"。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="settings">
        <maml:name>config</maml:name>
        <maml:description>
          <maml:para>API 调用的动态设置,它可以满足每个模型的所有要求。 请传递一个自定义对象到这个参数,如 @{temperature=1;max_tokens=1024}。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
        <dev:type>
          <maml:name>PSObject</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="out">
        <maml:name>outFile</maml:name>
        <maml:description>
          <maml:para>如果您希望将结果保存到文件中,您可以使用此参数设置文件路径。 您也可以使用 "out" 作为别名。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>json</maml:name>
        <maml:description>
          <maml:para>以 json 格式发送响应。</maml:para>
        </maml:description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="variables">
        <maml:name>context</maml:name>
        <maml:description>
          <maml:para>如果您希望将一些动态值传递给提示,您可以在这里使用 context 参数。 它可以是任何东西,您只需在这里指定一个自定义的 PowerShell 对象。 您可以通过使用 {{you_variable_name}} 语法在系统提示或用户提示中定义变量,然后将数据传递给 context 参数,如 @{you_variable_name="your value"}。 如果有多个变量,您可以使用 @{variable1="value1";variable2="value2"}。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
        <dev:type>
          <maml:name>PSObject</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>headers</maml:name>
        <maml:description>
          <maml:para>如果您希望将一些自定义头传递到 API 调用,您可以使用此参数。 您可以传递一个自定义的哈希表给这个参数,如 @{header1="value1";header2="value2"}。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
        <dev:type>
          <maml:name>PSObject</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.String, 完成的结果。</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
        <dev:code>New-ChatGPTConversation</dev:code>
        <dev:remarks>
          <maml:para>使用所有默认设置的 OpenAI Service,将从环境变量 (OPENAI_API_KEY) 读取 API 密钥,进入聊天模式。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
        <dev:code>New-ChatGPTConversation -api_key "your api key" -model "gpt-3.5-turbo"</dev:code>
        <dev:remarks>
          <maml:para>使用指定的 API 密钥和模型的 OpenAI Service,进入聊天模式。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
        <dev:code>chat -system "You help me to translate the text to Chinese."</dev:code>
        <dev:remarks>
          <maml:para>使用 OpenAI Service 翻译文本(指定系统提示),将从环境变量 (OPENAI_API_KEY) 读取 API 密钥,进入聊天模式。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title>
        <dev:code>chat -endpoint "ollama" -model "llama3"</dev:code>
        <dev:remarks>
          <maml:para>使用本地模型的 OpenAI Service,进入聊天模式。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title>
        <dev:code>chat -endpoint $endpoint $env:OPENAI_API_ENDPOINT_AZURE -model $env:OPENAI_API_MODEL_AZURE -api_key $env:OPENAI_API_KEY_AZURE</dev:code>
        <dev:remarks>
          <maml:para>使用指定的 API 密钥和模型的 Azure OpenAI Service,进入聊天模式。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 6 --------------------------</maml:title>
        <dev:code>gpt -system "Translate the text to Chinese." -prompt "Hello, how are you?"</dev:code>
        <dev:remarks>
          <maml:para>使用 OpenAI Service 翻译文本(指定系统提示),将从环境变量 (OPENAI_API_KEY) 读取 API 密钥,模型从 OPENAI_API_MODEL 读取(如果存在)或默认使用 "gpt-3.5-turbo",直接获取聊天完成结果。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 7 --------------------------</maml:title>
        <dev:code>"Hello, how are you?" | gpt -system "Translate the text to Chinese."</dev:code>
        <dev:remarks>
          <maml:para>使用 OpenAI Service 翻译文本(指定系统提示,用户提示将通过管道传递),将从环境变量 (OPENAI_API_KEY) 读取 API 密钥,模型从 OPENAI_API_MODEL 读取(如果存在)或默认使用 "gpt-3.5-turbo",直接获取聊天完成结果。</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>https://github.com/chenxizhang/openai-powershell</maml:linkText>
        <maml:uri>https://github.com/chenxizhang/openai-powershell</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>New-ImageGeneration</command:name>
      <command:verb>New</command:verb>
      <command:noun>ImageGeneration</command:noun>
      <maml:description>
        <maml:para>使用 DALL-E-3 模型从提示生成图像。</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>使用 DALL-E-3 模型从提示生成图像。 图像大小可以是 1024x1024,1792x1024,1024x1792。</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>New-ImageGeneration</maml:name>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>prompt</maml:name>
          <maml:description>
            <maml:para>生成图像的提示,这是必需的,并且可以从管道传递。 如果您想使用文件作为提示,可以在这里指定文件路径。 您也可以指定一个 URL 作为提示,我们将读取 URL 作为提示。 您可以通过使用 "lib:xxxxx" 作为提示,从库(https://github.com/code365opensource/promptlibrary)中读取提示,例如,"lib:fitness"。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>api_key</maml:name>
          <maml:description>
            <maml:para>访问 OpenAI 服务的 API 密钥,如果没有指定,API 密钥将从环境变量 OPENAI_API_KEY 中读取。 如果您使用 Azure OpenAI 服务,您可以通过环境变量 OPENAI_API_KEY_AZURE 或 OPENAI_API_KEY_AZURE_&lt;environment&gt; 指定 API 密钥,&lt;environment&gt; 可以是您想要的任何名称,例如,OPENAI_API_KEY_AZURE_DEV,OPENAI_API_KEY_AZURE_PROD,OPENAI_API_KEY_AZURE_TEST 等。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>endpoint</maml:name>
          <maml:description>
            <maml:para>访问 OpenAI 服务的端点,如果没有指定,端点将从环境变量 OPENAI_ENDPOINT 中读取。 如果您使用 Azure OpenAI 服务,您可以通过环境变量 OPENAI_ENDPOINT_AZURE 或 OPENAI_ENDPOINT_AZURE_&lt;environment&gt; 指定端点,&lt;environment&gt; 可以是您想要的任何名称,例如,OPENAI_ENDPOINT_AZURE_DEV,OPENAI_ENDPOINT_AZURE_PROD,OPENAI_ENDPOINT_AZURE_TEST 等。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>azure</maml:name>
          <maml:description>
            <maml:para>使用 Azure OpenAI 服务,如果指定,API 密钥和端点将从环境变量 OPENAI_API_KEY_AZURE 或 OPENAI_API_KEY_AZURE_&lt;environment&gt; 中读取,&lt;environment&gt; 可以是您想要的任何名称,例如,OPENAI_API_KEY_AZURE_DEV,OPENAI_API_KEY_AZURE_PROD,OPENAI_API_KEY_AZURE_TEST 等。 和 OPENAI_ENDPOINT_AZURE 或 OPENAI_ENDPOINT_AZURE_&lt;environment&gt;。</maml:para>
          </maml:description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>size</maml:name>
          <maml:description>
            <maml:para>要生成的图像的大小,值可以是 small (1024x1024),medium(1792x1024),large(1024x1792),默认是 small。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>Small</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="out">
          <maml:name>outfolder</maml:name>
          <maml:description>
            <maml:para>保存生成的图像的文件夹,默认是当前文件夹。 您可以使用 out 作为此参数的别名。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>.</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="env">
          <maml:name>environment</maml:name>
          <maml:description>
            <maml:para>环境名称,如果您使用 Azure OpenAI 服务,可以通过此参数指定环境,环境名称可以是您想要的任何名称,例如,dev,prod,test 等,环境名称将用于从环境变量中读取 API 密钥和端点,例如,OPENAI_API_KEY_AZURE_DEV,OPENAI_ENDPOINT_AZURE_DEV 等。 您可以使用 env 作为此参数的别名。</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
        <maml:name>prompt</maml:name>
        <maml:description>
          <maml:para>生成图像的提示,这是必需的,并且可以从管道传递。 如果您想使用文件作为提示,可以在这里指定文件路径。 您也可以指定一个 URL 作为提示,我们将读取 URL 作为提示。 您可以通过使用 "lib:xxxxx" 作为提示,从库(https://github.com/code365opensource/promptlibrary)中读取提示,例如,"lib:fitness"。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>api_key</maml:name>
        <maml:description>
          <maml:para>访问 OpenAI 服务的 API 密钥,如果没有指定,API 密钥将从环境变量 OPENAI_API_KEY 中读取。 如果您使用 Azure OpenAI 服务,您可以通过环境变量 OPENAI_API_KEY_AZURE 或 OPENAI_API_KEY_AZURE_&lt;environment&gt; 指定 API 密钥,&lt;environment&gt; 可以是您想要的任何名称,例如,OPENAI_API_KEY_AZURE_DEV,OPENAI_API_KEY_AZURE_PROD,OPENAI_API_KEY_AZURE_TEST 等。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>endpoint</maml:name>
        <maml:description>
          <maml:para>访问 OpenAI 服务的端点,如果没有指定,端点将从环境变量 OPENAI_ENDPOINT 中读取。 如果您使用 Azure OpenAI 服务,您可以通过环境变量 OPENAI_ENDPOINT_AZURE 或 OPENAI_ENDPOINT_AZURE_&lt;environment&gt; 指定端点,&lt;environment&gt; 可以是您想要的任何名称,例如,OPENAI_ENDPOINT_AZURE_DEV,OPENAI_ENDPOINT_AZURE_PROD,OPENAI_ENDPOINT_AZURE_TEST 等。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>azure</maml:name>
        <maml:description>
          <maml:para>使用 Azure OpenAI 服务,如果指定,API 密钥和端点将从环境变量 OPENAI_API_KEY_AZURE 或 OPENAI_API_KEY_AZURE_&lt;environment&gt; 中读取,&lt;environment&gt; 可以是您想要的任何名称,例如,OPENAI_API_KEY_AZURE_DEV,OPENAI_API_KEY_AZURE_PROD,OPENAI_API_KEY_AZURE_TEST 等。 和 OPENAI_ENDPOINT_AZURE 或 OPENAI_ENDPOINT_AZURE_&lt;environment&gt;。</maml:para>
        </maml:description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>size</maml:name>
        <maml:description>
          <maml:para>要生成的图像的大小,值可以是 small (1024x1024),medium(1792x1024),large(1024x1792),默认是 small。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>Small</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="out">
        <maml:name>outfolder</maml:name>
        <maml:description>
          <maml:para>保存生成的图像的文件夹,默认是当前文件夹。 您可以使用 out 作为此参数的别名。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>.</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="env">
        <maml:name>environment</maml:name>
        <maml:description>
          <maml:para>环境名称,如果您使用 Azure OpenAI 服务,可以通过此参数指定环境,环境名称可以是您想要的任何名称,例如,dev,prod,test 等,环境名称将用于从环境变量中读取 API 密钥和端点,例如,OPENAI_API_KEY_AZURE_DEV,OPENAI_ENDPOINT_AZURE_DEV 等。 您可以使用 env 作为此参数的别名。</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.String, 生成的图像的文件路径。</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
        <dev:code>New-ImageGeneration -prompt "A painting of a cat sitting on a chair"</dev:code>
        <dev:remarks>
          <maml:para>使用 dall-e-3 模型生成图像,图像大小为 1024x1024,生成的图像将保存到当前文件夹。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
        <dev:code>image -prompt "A painting of a cat sitting on a chair"</dev:code>
        <dev:remarks>
          <maml:para>使用别名(image)生成图像,图像大小为 1024x1024,生成的图像将保存到当前文件夹。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
        <dev:code>"A painting of a cat sitting on a chair" | New-ImageGeneration</dev:code>
        <dev:remarks>
          <maml:para>从管道传递提示,图像大小为 1024x1024,生成的图像将保存到当前文件夹。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title>
        <dev:code>New-ImageGeneration -prompt "A painting of a cat sitting on a chair" -size medium -outfolder "c:\temp" -api_key "your API key" -endpoint "your endpoint"</dev:code>
        <dev:remarks>
          <maml:para>使用 dall-e-3 模型生成图像,图像大小为 1792x1024,生成的图像将保存到 c:\temp 文件夹,使用您自己的 API 密钥和端点。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title>
        <dev:code>New-ImageGeneration -prompt "A painting of a cat sitting on a chair" -size small -outfolder "c:\temp" -azure</dev:code>
        <dev:remarks>
          <maml:para>使用 dall-e-3 模型生成图像,图像大小为 1024x1024,生成的图像将保存到 c:\temp 文件夹,使用 Azure OpenAI 服务。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 6 --------------------------</maml:title>
        <dev:code>New-ImageGeneration -prompt "A painting of a cat sitting on a chair" -size small -outfolder "c:\temp" -azure -environment "dev"</dev:code>
        <dev:remarks>
          <maml:para>使用 dall-e-3 模型生成图像,图像大小为 1024x1024,生成的图像将保存到 c:\temp 文件夹,使用 Azure OpenAI 服务,从环境变量 OPENAI_API_KEY_AZURE_DEV 和 OPENAI_ENDPOINT_AZURE_DEV 中读取 API 密钥和端点。</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 7 --------------------------</maml:title>
        <dev:code>New-ImageGeneration -outfolder "c:\temp" -azure -prompt "c:\temp\prompt.txt"</dev:code>
        <dev:remarks>
          <maml:para>使用 dall-e-3 模型生成图像,图像大小为 1024x1024,生成的图像将保存到 c:\temp 文件夹,使用 Azure OpenAI 服务,并使用文件 c:\temp\prompt.txt 中的提示</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>https://github.com/chenxizhang/openai-powershell</maml:linkText>
        <maml:uri>https://github.com/chenxizhang/openai-powershell</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>