Skip to content

Commit 3661b4b

Browse files
committed
Formatting and model updates
1 parent aab797d commit 3661b4b

File tree

262 files changed

+7308
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+7308
-216
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
# llm_coder
2-
LLM Coder package
1+
# ABAP AI LLM Coder
32

4-
Still trying out stuff.
3+
**Status**: Early preview, expect major changes (already planned). Focus is to show the [Documentation Showcase](https://abap-ai.github.io/llm_coder/).
4+
5+
This repository will in future contain coder support related topics. Note you need the llm client and llm agent package to run this.
6+
7+
## Showcase - Generated ABAP Documentation
8+
9+
[Documentation Showcase](https://abap-ai.github.io/llm_coder/):
10+
11+
* Generated documentation of the llm_client repo
12+
* Differnet models used to show differences
13+
* Focus on a simple overview and to give you an idea what to do with the llm client and agent
14+
* Simple, not yet optimized prompts.
15+
16+
Early Learnings:
17+
18+
* Promising - high level overview usually enough. While it would be possible to generate very detailed documentations this is usually not required. ABAP developers are used to look at code and have easy access --> focus on giving a high level overview only.
19+
* Agents are the preferred interface. Using the client directly is only relevant for special cases --> Plan is to merge the client and agent package.
20+
* Agents should have some default retry- and error correction logic to catch simple and common fails.
21+
* There are many simple markdown issues - not a big deal but the tool used to display the documentation takes this serious --> consider some automated corrections or do it later on github

docs/Claude 3.5 Haiku/FUGR/Z_LLM_CLIENT/TABLEFRAME_Z_LLM_CLIENT.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ parent_type: FUGR
88
# Function Module TABLEFRAME_Z_LLM_CLIENT
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The function module `TABLEFRAME_Z_LLM_CLIENT` is a standard SAP view maintenance generator function designed to handle table frame operations for a custom client-related table. It appears to be an automatically generated function module used for managing view maintenance activities in an SAP ABAP system.
1315

1416
## Dependencies
17+
1518
- Standard SAP View Maintenance Framework
1619
- Performs operations on predefined tables:
1720
- `X_HEADER`
@@ -21,6 +24,7 @@ The function module `TABLEFRAME_Z_LLM_CLIENT` is a standard SAP view maintenance
2124
- `EXCL_CUA_FUNCT`
2225

2326
## Details
27+
2428
The function module utilizes the `PERFORM TABLEFRAME` statement, which is a standard SAP mechanism for view maintenance. It passes several key parameters:
2529

2630
```mermaid
@@ -37,10 +41,10 @@ graph TD
3741
```
3842

3943
Key characteristics:
44+
4045
- Automatically generated on 02.01.2025
4146
- Part of view maintenance generator version #001407#
4247
- Handles table frame operations for a custom table related to LLM (likely Large Language Model) client configuration
4348
- Provides a standardized interface for view-based table maintenance in SAP
4449

4550
The function is designed to be a generic handler for view-related operations, likely supporting standard CRUD (Create, Read, Update, Delete) actions on the associated table.
46-

docs/Claude 3.5 Haiku/FUGR/Z_LLM_CLIENT/TABLEPROC_Z_LLM_CLIENT.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ parent_type: FUGR
88
# Function Module TABLEPROC_Z_LLM_CLIENT
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The function module `TABLEPROC_Z_LLM_CLIENT` appears to be a generic table processing function generated on 02.01.2025. Its primary purpose seems to be executing a standard table procedure through the `TABLEPROC` perform, which suggests it is likely part of a generated view maintenance or table management framework.
1315

1416
## Dependencies
17+
1518
No explicit dependencies are visible from the provided source code snippet. The function relies on a perform routine `TABLEPROC`, which is likely defined in a common include or standard SAP library.
1619

1720
## Details
21+
1822
The function module is extremely minimal, containing only a single perform call to `TABLEPROC`. This suggests it is:
23+
1924
- Likely part of an automated code generation process
2025
- Probably a wrapper or standardized entry point for table-related operations
2126
- Potentially used in view maintenance or data management scenarios for a client-related table (Z_LLM_CLIENT)
@@ -29,4 +34,3 @@ flowchart TD
2934
```
3035

3136
Without additional context from the common includes, the exact nature of the table processing cannot be definitively determined, but it appears to be a standardized approach to handling table-related operations.
32-

docs/Claude 3.5 Haiku/ZCL_LLM_AUTH_DISABLED_CLAS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ parent_type: DEVC
88
# Class ZCL_LLM_AUTH_DISABLED
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The `zcl_llm_auth_disabled` class is an implementation of the `zif_llm_auth` interface that provides a permissive authorization mechanism. This class is designed to disable or bypass authorization checks for various cryptographic and client-related operations. It serves as a default or test implementation where no strict authorization restrictions are enforced.
1315

1416
The class implements four key authorization methods:
17+
1518
1. `check_decrypt()`: Authorization check for decryption operations
1619
2. `check_encrypt()`: Authorization check for encryption operations
1720
3. `check_get_client()`: Authorization check for client retrieval
@@ -20,11 +23,14 @@ The class implements four key authorization methods:
2023
Each method is intentionally left empty, effectively allowing all operations without raising authorization exceptions.
2124

2225
## Dependencies
26+
2327
- Interface: `zif_llm_auth`
2428
- Potential Exception: `ZCX_LLM_AUTHORIZATION` (not raised in this implementation)
2529

2630
## Details
31+
2732
The class represents a "disabled" authorization strategy, which is particularly useful in:
33+
2834
- Testing scenarios
2935
- Development environments
3036
- Situations requiring unrestricted access to cryptographic methods
@@ -44,10 +50,10 @@ graph TD
4450
```
4551

4652
Key characteristics:
53+
4754
- Provides a "pass-through" authorization mechanism
4855
- Marked as `FINAL` and `PUBLIC`, preventing further inheritance
4956
- Uses `#EC EMPTY_PROCEDURE` to suppress potential code inspector warnings about empty methods
5057
- Intended to be registered in a BADI (Business Add-In) named `ZLLM_DEFAULTS`
5158

5259
The implementation suggests a flexible design where custom authorization logic can be easily plugged in by replacing this default implementation.
53-

docs/Claude 3.5 Haiku/ZCL_LLM_CALL_LOGGER_CLAS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@ parent_type: DEVC
88
# Class ZCL_LLM_CALL_LOGGER
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The `zcl_llm_call_logger` is a specialized ABAP class designed to log LLM (Large Language Model) call entries with configurable logging behavior. It implements the `zif_llm_call_logger` interface and provides a mechanism to conditionally log entries based on system settings and user filters.
1315

1416
Key functionalities:
17+
1518
- Conditional logging of LLM call entries
1619
- System-wide logging activation control
1720
- User-specific logging filter
1821
- Automatic configuration during object instantiation
1922

2023
Public Methods:
24+
2125
- `zif_llm_call_logger~add()`: Logs an entry to the `zllm_call_log` table if logging is active
2226
- `constructor()`: Initializes logging configuration by checking system settings
2327

2428
## Dependencies
29+
2530
- Database Table: `zllm_system` (for system configuration)
2631
- Database Table: `zllm_call_log` (for storing log entries)
2732
- Interface: `zif_llm_call_logger`
2833

2934
## Details
35+
3036
The logging mechanism follows a two-stage filtering process:
3137

3238
```mermaid
@@ -39,6 +45,7 @@ flowchart TD
3945
```
4046

4147
Logging Configuration Logic:
48+
4249
1. During object creation, the constructor queries the `zllm_system` table
4350
2. Checks if system-wide logging is enabled (`save_calls = abap_true`)
4451
3. Validates user filter:
@@ -47,9 +54,9 @@ Logging Configuration Logic:
4754
4. Sets the `active` flag accordingly
4855

4956
When `zif_llm_call_logger~add()` is called:
57+
5058
- Checks the `active` flag
5159
- If active, inserts the entry into `zllm_call_log`
5260
- If inactive, silently returns without logging
5361

5462
This design allows flexible, configurable logging with minimal performance overhead.
55-

docs/Claude 3.5 Haiku/ZCL_LLM_CHAT_REQUEST_CLAS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ parent_type: DEVC
88
# Class ZCL_LLM_CHAT_REQUEST
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The `zcl_llm_chat_request` class is an implementation of the `zif_llm_chat_request` interface, designed to manage and manipulate chat requests for Large Language Model (LLM) interactions. It provides a comprehensive set of methods to:
15+
1316
- Add and manage chat messages
1417
- Handle tools and tool results
1518
- Configure structured output
1619
- Manage tool choices
1720
- Retrieve internal request details
1821

1922
Key public methods include:
23+
2024
- `add_message`: Add a single message to the request
2125
- `add_messages`: Add multiple messages at once
2226
- `add_tool`: Add a tool to the request
@@ -28,11 +32,13 @@ Key public methods include:
2832
- `get_internal_request`: Retrieve the full internal request object
2933

3034
## Dependencies
35+
3136
- `zif_llm_client`: Interface for role constants
3237
- `zcl_llm_common`: Utility class for JSON conversion
3338
- `zllm_request`: Custom data type for storing chat request details
3439

3540
## Details
41+
3642
The class uses a central `request` attribute of type `zllm_request` to store and manage all request-related information. It acts as a builder/configuration class for preparing LLM chat requests with flexible options.
3743

3844
```mermaid
@@ -51,11 +57,11 @@ classDiagram
5157
```
5258

5359
Key design characteristics:
60+
5461
- Implements a fluent interface for building chat requests
5562
- Supports dynamic addition of messages, tools, and tool results
5663
- Provides methods for configuring advanced LLM request features
5764
- Maintains a flexible internal request structure
5865
- Allows retrieval of the complete configured request object
5966

6067
The class is designed to be used as a configuration builder before sending a request to an LLM client, providing a type-safe and structured approach to preparing chat interactions.
61-

docs/Claude 3.5 Haiku/ZCL_LLM_CLIENT_BASE_CLAS.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@ parent_type: DEVC
88
# Class ZCL_LLM_CLIENT_BASE
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
`zcl_llm_client_base` is an abstract base class for implementing Large Language Model (LLM) clients across different providers. It provides a standardized framework for:
15+
1316
- Creating chat requests
1417
- Handling HTTP communication
1518
- Processing LLM responses
1619
- Managing tool calls and structured outputs
1720

1821
Key public methods:
22+
1923
- `chat()`: Sends a chat request to the LLM provider
2024
- `new_request()`: Creates a new chat request with default configurations
2125
- `get_client()`: Retrieves a provider-specific client implementation
2226

2327
## Dependencies
28+
2429
- `zif_llm_client`: Main client interface
2530
- `zif_llm_http_client_wrapper`: HTTP communication wrapper
2631
- `zif_llm_tool_parser`: Tool parameter parsing
2732
- `zif_llm_statistics`: Statistics tracking
2833

2934
## Details
35+
3036
The class implements a flexible and extensible architecture for LLM interactions with several key design aspects:
3137

3238
```mermaid
@@ -42,12 +48,14 @@ classDiagram
4248
```
4349

4450
Key architectural patterns:
51+
4552
- Abstract methods for provider-specific implementations
4653
- Standardized response and request handling
4754
- Flexible tool call and structured output processing
4855
- Configurable via client and provider configurations
4956

5057
Request processing flow:
58+
5159
1. Create request via `new_request()`
5260
2. Configure request parameters
5361
3. Call `chat()` method
@@ -58,10 +66,10 @@ Request processing flow:
5866
- Tool call processing
5967

6068
The class supports:
69+
6170
- Multiple LLM providers
6271
- Structured output generation
6372
- Tool call execution
6473
- Detailed usage statistics tracking
6574

6675
Extensibility is achieved through abstract methods like `get_chat_endpoint()`, `set_auth()`, allowing provider-specific implementations while maintaining a consistent interface.
67-

docs/Claude 3.5 Haiku/ZCL_LLM_COMMON_CLAS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,27 @@ parent_type: DEVC
88
# Class ZCL_LLM_COMMON
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The `zcl_llm_common` is a utility class designed to provide JSON serialization and deserialization functionality with dynamic JSON implementation resolution. It offers two primary public methods:
15+
1316
- `to_json()`: Converts ABAP data structures to JSON strings
1417
- `from_json()`: Converts JSON strings back to ABAP data structures
1518

1619
The class uses a dynamically resolved JSON implementation class and supports optional JSON compression.
1720

1821
## Dependencies
22+
1923
- `/ui2/cl_json`: JSON serialization/deserialization utility
2024
- `zllm_implementation` Business Add-In (BADI) for JSON implementation configuration
2125

2226
## Details
27+
2328
The class implements a flexible JSON conversion mechanism through several key design elements:
2429

2530
### Dynamic JSON Implementation Resolution
31+
2632
```mermaid
2733
sequenceDiagram
2834
participant Class Constructor
@@ -37,15 +43,18 @@ sequenceDiagram
3743
The `class_constructor` method dynamically retrieves the JSON implementation class through a BADI, allowing runtime configuration of the JSON serialization strategy.
3844

3945
### JSON Conversion Methods
46+
4047
The `to_json()` and `from_json()` methods use dynamic method calls to the resolved JSON implementation class, with the following characteristics:
48+
4149
- Supports low-case property naming
4250
- Optional JSON compression in `to_json()`
4351
- Handles various data structure types
4452

4553
### Configuration Persistence
54+
4655
The class maintains two private class-level attributes:
56+
4757
- `json_class`: Stores the dynamically resolved JSON implementation class name
4858
- `llm_badi`: Holds a reference to the LLM implementation BADI
4959

5060
The `get_llm_badi()` method provides access to the BADI instance, enabling further configuration or interaction if needed.
51-

docs/Claude 3.5 Haiku/ZCL_LLM_DEFAULT_IMPL_CLAS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,29 @@ parent_type: DEVC
88
# Class ZCL_LLM_DEFAULT_IMPL
99

1010
AI Generated documentation.
11+
1112
## Overview
13+
1214
The `zcl_llm_default_impl` class is a default implementation provider for various system components related to Large Language Model (LLM) interactions. It implements the `zif_llm_default_impl` interface and provides singleton-like access to key implementation classes for encryption, logging, statistics, and authorization.
1315

1416
Public methods include:
17+
1518
- `get_encryption_impl()`: Returns an encryption implementation
1619
- `get_json_impl()`: Returns a JSON handling class
1720
- `get_call_logger_impl()`: Returns a call logging implementation
1821
- `get_statistics_impl()`: Returns a statistics tracking implementation
1922
- `get_authorization_impl()`: Returns an authorization implementation
2023

2124
## Dependencies
25+
2226
- `zif_llm_encryption`
2327
- `zif_llm_statistics`
2428
- `zif_llm_call_logger`
2529
- `zif_llm_auth`
2630

2731
## Details
28-
The class uses a lazy initialization pattern for its implementation classes, creating instances only when first requested.
32+
33+
The class uses a lazy initialization pattern for its implementation classes, creating instances only when first requested.
2934

3035
```mermaid
3136
classDiagram
@@ -44,10 +49,10 @@ classDiagram
4449
```
4550

4651
Key implementation details:
52+
4753
- Uses class-level static references to cache implementation instances
4854
- Provides a centralized point for retrieving default implementations
4955
- Default authorization implementation uses a disabled authorization class
5056
- JSON implementation directly returns the standard SAP JSON class path
5157

5258
The design allows for easy extension and replacement of core LLM interaction components through a centralized interface.
53-

0 commit comments

Comments
 (0)