Azure OpenAI (AOAI)

Schritt 1

Um die Azure OpenAI-API zu nutzen, müssen Sie ein Konto auf der Azure OpenAI-Website erstellen. Nach der Erstellung eines Kontos können Sie die AOAI-API bereitstellen und auf den API-Schlüssel zugreifen.

Schritt 2

Nachdem Sie den API-Schlüssel erhalten haben, können Sie HOST_AGENT und APP_AGENT in der Datei config.yaml konfigurieren (benennen Sie die Datei config_template.yaml in config.yaml um), um die Azure OpenAI-API zu verwenden. Das Folgende ist eine Beispielkonfiguration für die 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

Wenn Sie AAD für die Authentifizierung verwenden möchten, sollten Sie auch die folgende Konfiguration festlegen

    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

Tipp

Wenn Sie VISUAL_MODE auf True setzen, stellen Sie sicher, dass die API_DEPLOYMENT_ID visuelle Eingaben unterstützt.

Schritt 3

Nachdem Sie HOST_AGENT und APP_AGENT mit der OpenAI-API konfiguriert haben, können Sie UFO verwenden, um mit der AOAI-API für verschiedene Aufgaben unter Windows OS zu interagieren. Weitere Details zum Einstieg mit UFO finden Sie im Schnellstartleitfaden.