Azure OpenAI (AOAI)

第一步

要使用 Azure OpenAI API,您需要在 Azure OpenAI 网站上创建一个帐户。创建帐户后,您可以部署 AOAI API 并获取 API 密钥。

第二步

获取 API 密钥后,您可以在 config.yaml 文件中(将 config_template.yaml 文件重命名为 config.yaml)配置 HOST_AGENTAPP_AGENT 以使用 Azure OpenAI API。以下是 Azure OpenAI API 的配置示例:

VISUAL_MODE: True, # Whether to use visual mode to understand screenshots and take actions
API_TYPE: "aoai" , # The API type, "openai" for the OpenAI API, "aoai" for the AOAI API, 'azure_ad' for the ad authority of the AOAI API.  
API_BASE: "YOUR_ENDPOINT", #  The AOAI API address. Format: https://{your-resource-name}.openai.azure.com
API_KEY: "YOUR_KEY",  # The aoai API key
API_VERSION: "2024-02-15-preview", # The version of the API, "2024-02-15-preview" by default
API_MODEL: "gpt-4-vision-preview",  # The OpenAI model name, "gpt-4-vision-preview" by default. You may also use "gpt-4o" for using the GPT-4O model.
API_DEPLOYMENT_ID: "YOUR_AOAI_DEPLOYMENT", # The deployment id for the AOAI API

如果您想使用 AAD 进行身份验证,您还应该设置以下配置:

    AAD_TENANT_ID: "YOUR_TENANT_ID", # Set the value to your tenant id for the llm model
    AAD_API_SCOPE: "YOUR_SCOPE", # Set the value to your scope for the llm model
    AAD_API_SCOPE_BASE: "YOUR_SCOPE_BASE" # Set the value to your scope base for the llm model, whose format is API://YOUR_SCOPE_BASE, and the only need is the YOUR_SCOPE_BASE

提示

如果您将 VISUAL_MODE 设置为 True,请确保 API_DEPLOYMENT_ID 支持视觉输入。

第三步

使用 OpenAI API 配置 HOST_AGENTAPP_AGENT 后,您可以开始使用 UFO 与 AOAI API 交互,以在 Windows 操作系统上执行各种任务。有关如何开始使用 UFO 的更多详细信息,请参阅快速入门指南