OpenAI

第一步

要使用 OpenAI API,您需要在 OpenAI 网站上创建一个账户。创建账户后,您可以从API 密钥页面获取 API 密钥。

第二步

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

VISUAL_MODE: True, # Whether to use visual mode to understand screenshots and take actions
API_TYPE: "openai" , # 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: "https://api.openai.com/v1/chat/completions", # The the OpenAI API endpoint, "https://api.openai.com/v1/chat/completions" for the OpenAI API.
API_KEY: "sk-",  # The OpenAI API key, begin with sk-
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.

提示

如果您将 VISUAL_MODE 设置为 True,请确保 API_MODEL 支持视觉输入。您可以在此处找到模型列表。

第三步

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