Package ZLLM_CLIENT
AI Generated documentation.
Overview
This ABAP package provides a secure, extensible framework for integrating Large Language Models (LLMs) into SAP systems. It enables standardized interaction with multiple AI providers (OpenAI, Azure, Anthropic, etc.) through encrypted communication, structured request/response handling, and centralized configuration management.
Core Capabilities
- Multi-Provider Support: Implements dedicated clients for major LLM APIs (OpenAI, Azure, Anthropic, OpenRouter) with provider-specific authentication and payload formatting
- Security Framework: Integrates certificate-based encryption, authorization checks, and secure credential storage using SAP SSF/STRUST
- Structured AI Interactions: Manages complex chat workflows with tool integration (calculator, echo), JSON schema validation, and template-based content generation
- Operational Control: Configurable logging, usage statistics, and system-wide activation controls via central configuration tables
- Extensible Architecture: Uses BAdIs and factory patterns for dynamic implementation swapping, enabling custom tools, encryption, and authorization scenarios
Technical Foundation
- Abstract base classes for HTTP communication, response parsing, and client lifecycle management
- JSON schema generation from ABAP structures with type validation
- Lightweight template engine supporting conditional logic and loops
- Pluggable components for encryption, logging, and statistics via standardized interfaces
- Central exception handling with domain-specific error classes (HTTP, auth, validation)
Integration Features
- CRUD operations for provider configurations with ALV-based maintenance
- Support for streaming responses and asynchronous processing
- Tool execution framework enabling LLMs to trigger ABAP logic
- Dynamic client instantiation with model/provider relationship validation