Azure
Large Language Model service implementation using Azure OpenAI API
Overview
AzureLLMService
extends the BaseOpenAILLMService to provide Azure-specific OpenAI model integration. It maintains compatibility with OpenAI’s interface while using Azure’s endpoints.
Installation
To use AzureLLMService
, install the required dependencies:
You’ll also need to set up the following environment variables:
AZURE_API_KEY
AZURE_REGION
Configuration
Constructor Parameters
Azure OpenAI API key
Azure OpenAI endpoint URL
Model deployment name
Azure OpenAI API version
Input Parameters
Inherits all input parameters from OpenAILLMService:
Input Frames
Contains OpenAI-specific conversation context
Contains conversation messages
Contains image for vision model processing
Updates model settings
Output Frames
Contains generated text chunks
Indicates start of function call
Contains function call results
Methods
See the LLM base class methods for additional functionality.
Usage Example
Function Calling
Supports OpenAI-compatible function calling:
Frame Flow
Metrics Support
The service collects the same metrics as OpenAILLMService:
- Token usage (prompt and completion)
- Processing duration
- Time to First Byte (TTFB)
- Function call metrics
Notes
- OpenAI-compatible interface
- Supports streaming responses
- Handles function calling
- Manages conversation context
- Includes token usage tracking
- Thread-safe processing
- Automatic error handling
- Inherits OpenAI service features