Azure OpenAI - Chat Completion
Leverage advanced AI models from Azure OpenAI to perform complex tasks such as categorization, analysis, summarization, or decision support.
For more information on the API for chat completion, see Work with chat completion models (opens in a new tab).
SDK Import:
from admyral.actions import azure_openai_chat_completion
Arguments:
Argument Name | Description | Required |
---|---|---|
Prompt prompt | The input prompt to use for generating the chat completion. | Yes |
Top P top_p | Value between 0 and 1 for nucleus sampling. Only tokens with the top P probability mass are considered. Recommended to tweak this or temperature, but not both. | - |
Temperature temperature | Sampling temperature, between 0 and 2. Higher values (e.g., 0.8) increase randomness, while lower values (e.g., 0.2) make output more deterministic. Recommended to adjust this or Top P, but not both. | - |
Stop Tokens stop_tokens | A list of tokens to stop the completion upon encountering. | - |
Returns
A string.
Required Secrets
Secret Placeholder | Description |
---|---|
AZURE_OPENAI_SECRET | Azure OpenAI secret. See Abnormal Security setup |
SDK Example
response = azure_openai_chat_completion(
prompt="Why is the ocean salty?",
secrets={
"AZURE_OPENAI_SECRET": "my_azure_openai_secret"
}
)