diff --git a/file-formats/intm/README.md b/file-formats/intm/README.md new file mode 100644 index 000000000..1912fa95d --- /dev/null +++ b/file-formats/intm/README.md @@ -0,0 +1,5 @@ +# INTM File Format + +File | Cardinality | Definition | Schema | Example +:--- | :--- | :--- | :--- | :--- +`.intm.json` | 1 | [`zif_aff_intm_v1.intf.abap`](./type/zif_aff_intm_v1.intf.abap) | [`intm-v1.json`](./intm-v1.json) | [`sapj97myt5r25l0v2ijp2rt1pko4.intm.json`](./examples/sapj97myt5r25l0v2ijp2rt1pko4.intm.json) diff --git a/file-formats/intm/examples/sapj97myt5r25l0v2ijp2rt1pko4.intm.json b/file-formats/intm/examples/sapj97myt5r25l0v2ijp2rt1pko4.intm.json new file mode 100644 index 000000000..61821d038 --- /dev/null +++ b/file-formats/intm/examples/sapj97myt5r25l0v2ijp2rt1pko4.intm.json @@ -0,0 +1,35 @@ +{ + "formatVersion": "1", + "header": { + "description": "Intelligent Scenario Model via ADT", + "originalLanguage": "en" + }, + "generalInformation": { + "modelName": "RM_TEST_ADT_976_MOD", + "modelType": "SAPGENAI", + "intelligentScenario": "RM_TEST_ADT_976", + "modellingContextId": "7FD071C0C04C56148FE3424E30FFB40B", + "adapterId": "SAPGENAI.Default", + "nativeModelType": "SAPGENAI.Default", + "state": "Published", + "executableId": "azure-openai", + "llmName": "gpt-4", + "llmVersion": "0613" + }, + "modelPromptTemplates": [ + { + "promptTemplateName": "SYSTEM_PROMPT", + "promptTemplateDescription": "System prompt", + "prompt": "You are a sales executive who is responsible for reaching out to customers for confirming or declining their orders. Evaluate the size of the delivery vehicle based on the number of items. Calculate the distance between the billing and delivery location in kilometers. \r\n\r\nThe subject of email should be of format \r\nThe body of email should be of format: \"\"SO contains to be delivered to . And will be delivered via a vehicle. \r\nIF > 100 kms THEN include a message about potential delivery delays ELSE congratulate on being eligible for one day delivery", + "promptParameters": "[]", + "isVisible": true + }, + { + "promptTemplateName": "USER_PROMPT", + "promptTemplateDescription": "User prompt", + "prompt": "Build a confirmation mail for a sales order containing {ISLM_Items} where the items are categorized for example pencil and paper will be stationary, printer and mouse will be electronics. The source address contains {ISLM_Source} and the delivery address is in {ISLM_Destination}.", + "promptParameters": "[{\"Name\":\"ISLM_Items\",\"Value\":\"\"},{\"Name\":\"ISLM_Source\",\"Value\":\"\"},{\"Name\":\"ISLM_Destination\",\"Value\":\"\"}]", + "isVisible": true + } + ] +} diff --git a/file-formats/intm/intm-v1.json b/file-formats/intm/intm-v1.json new file mode 100644 index 000000000..5c0f6f3f8 --- /dev/null +++ b/file-formats/intm/intm-v1.json @@ -0,0 +1,233 @@ +{ + "$comment": "This file is autogenerated, do not edit manually, see https://github.com/SAP/abap-file-formats for more information.", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/intm/intm-v1.json", + "title": "Intelligent scenario Model", + "description": "Intelligent scenario model", + "type": "object", + "properties": { + "formatVersion": { + "title": "ABAP File Format Version", + "description": "The ABAP file format version", + "type": "string", + "const": "1" + }, + "header": { + "title": "Header", + "description": "Header", + "type": "object", + "properties": { + "description": { + "title": "Description", + "description": "Description of the ABAP object", + "type": "string", + "maxLength": 60 + }, + "originalLanguage": { + "title": "Original Language", + "description": "Original language of the ABAP object", + "type": "string", + "minLength": 2 + }, + "abapLanguageVersion": { + "title": "ABAP Language Version", + "description": "ABAP language version", + "type": "string", + "enum": [ + "standard", + "keyUser", + "cloudDevelopment" + ], + "enumTitles": [ + "Standard", + "ABAP for Key Users", + "ABAP Cloud Development" + ], + "enumDescriptions": [ + "Standard", + "ABAP for key user extensibility", + "ABAP cloud development" + ], + "default": "standard" + } + }, + "additionalProperties": false, + "required": [ + "description", + "originalLanguage" + ] + }, + "generalInformation": { + "title": "General Information", + "description": "General information", + "type": "object", + "properties": { + "modelName": { + "title": "Model Name", + "description": "Model name", + "type": "string", + "maxLength": 30 + }, + "modelType": { + "title": "Model Type", + "description": "Model type", + "type": "string", + "maxLength": 256 + }, + "intelligentScenario": { + "title": "Intelligent Scenario", + "description": "Intelligent scenario of the model", + "type": "string", + "maxLength": 20 + }, + "modellingContextId": { + "title": "Modelling Context ID", + "description": "Modelling context ID which is the parent of the model", + "type": "string", + "maxLength": 36 + }, + "adapterId": { + "title": "Adapter ID", + "description": "Adapter ID", + "type": "string", + "maxLength": 32 + }, + "nativeModelType": { + "title": "Native Model Type", + "description": "Native model type", + "type": "string", + "maxLength": 256 + }, + "modelSpecification": { + "title": "Model Specification", + "description": "Model specification", + "type": "string" + }, + "modelDefinition": { + "title": "Model Definition", + "description": "Model definition", + "type": "string" + }, + "state": { + "title": "State", + "description": "State of the model", + "type": "string", + "maxLength": 10 + }, + "signature": { + "title": "Signature", + "description": "Model signature", + "type": "string" + }, + "bindings": { + "title": "Bindings", + "description": "Model bindings", + "type": "string" + }, + "isEnhancement": { + "title": "Is Enhancement", + "description": "If true, the model is an enhancement, if false the model is a new model.", + "type": "boolean" + }, + "executableId": { + "title": "Executable ID", + "description": "Executable ID", + "type": "string", + "maxLength": 64 + }, + "llmName": { + "title": "Large Language Model Name", + "description": "Large language model name", + "type": "string" + }, + "llmVersion": { + "title": "Large Language Model Version", + "description": "Large language model version", + "type": "string", + "maxLength": 30 + } + }, + "additionalProperties": false + }, + "modelSegmentFields": { + "title": "Model Segment Fields", + "description": "Model segment fields", + "type": "array", + "items": { + "title": "Segment Field", + "description": "Model segment field", + "type": "object", + "properties": { + "fieldName": { + "title": "Field Name", + "description": "Table or view field name", + "type": "string", + "maxLength": 30 + }, + "fieldPosition": { + "title": "Field Position", + "description": "Field position", + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "isKey": { + "title": "Is Key Field", + "description": "If true, the field is a key field", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "modelPromptTemplates": { + "title": "Model Prompt Templates", + "description": "Model prompt templates", + "type": "array", + "items": { + "title": "Model Prompt Template", + "description": "Model prompt template", + "type": "object", + "properties": { + "promptTemplateName": { + "title": "Prompt Template Name", + "description": "Prompt template name", + "type": "string", + "maxLength": 30 + }, + "promptTemplateDescription": { + "title": "Prompt Template Description", + "description": "Description of prompt template", + "type": "string" + }, + "prompt": { + "title": "Prompt", + "description": "Prompt", + "type": "string" + }, + "promptParameters": { + "title": "Prompt Parameters", + "description": "Prompt parameters", + "type": "string" + }, + "isVisible": { + "title": "Prompt Visibility", + "description": "If true, the prompt is visible", + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "promptTemplateName", + "prompt" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "formatVersion", + "header", + "generalInformation" + ] +} diff --git a/file-formats/intm/type/zif_aff_intm_v1.intf.abap b/file-formats/intm/type/zif_aff_intm_v1.intf.abap new file mode 100644 index 000000000..1a9f13b1c --- /dev/null +++ b/file-formats/intm/type/zif_aff_intm_v1.intf.abap @@ -0,0 +1,111 @@ +INTERFACE zif_aff_intm_v1 + PUBLIC. + + TYPES: + "!

General Information

+ "! General information + BEGIN OF ty_general_information, + "!

Model Name

+ "! Model name + model_name TYPE c LENGTH 30, + "!

Model Type

+ "! Model type + model_type TYPE c LENGTH 256, + "!

Intelligent Scenario

+ "! Intelligent scenario of the model + intelligent_scenario TYPE c LENGTH 20, + "!

Modelling Context ID

+ "! Modelling context ID which is the parent of the model + modelling_context_id TYPE c LENGTH 36, + "!

Adapter ID

+ "! Adapter ID + adapter_id TYPE c LENGTH 32, + "!

Native Model Type

+ "! Native model type + native_model_type TYPE c LENGTH 256, + "!

Model Specification

+ "! Model specification + model_specification TYPE string, + "!

Model Definition

+ "! Model definition + model_definition TYPE string, + "!

State

+ "! State of the model + state TYPE c LENGTH 10, + "!

Signature

+ "! Model signature + signature TYPE string, + "!

Bindings

+ "! Model bindings + bindings TYPE string, + "!

Is Enhancement

+ "! If true, the model is an enhancement, if false the model is a new model. + is_enhancement TYPE abap_bool, + "!

Executable ID

+ "! Executable ID + executable_id TYPE c LENGTH 64, + "!

Large Language Model Name

+ "! Large language model name + llm_name TYPE string, + "!

Large Language Model Version

+ "! Large language model version + llm_version TYPE c LENGTH 30, + END OF ty_general_information, + + "!

Segment Field

+ "! Model segment field + BEGIN OF ty_segment_field, + "!

Field Name

+ "! Table or view field name + field_name TYPE c LENGTH 30, + "!

Field Position

+ "! Field position + field_position TYPE i, + "!

Is Key Field

+ "! If true, the field is a key field + is_key TYPE abap_bool, + END OF ty_segment_field, + + "!

Model Prompt Template

+ "! Model prompt template + BEGIN OF ty_prompt_template, + "!

Prompt Template Name

+ "! Prompt template name + "! $required + prompt_template_name TYPE c LENGTH 30, + "!

Prompt Template Description

+ "! Description of prompt template + prompt_template_description TYPE string, + "!

Prompt

+ "! Prompt + "! $required + prompt TYPE string, + "!

Prompt Parameters

+ "! Prompt parameters + prompt_parameters TYPE string, + "!

Prompt Visibility

+ "! If true, the prompt is visible + is_visible TYPE abap_bool, + END OF ty_prompt_template, + + "!

Intelligent scenario Model

+ "! Intelligent scenario model + BEGIN OF ty_main, + "! $required + format_version TYPE zif_aff_types_v1=>ty_format_version, + "!

Header

+ "! Header + "! $required + header TYPE zif_aff_types_v1=>ty_header_60, + "!

General Information

+ "! General information + "! $required + general_information TYPE ty_general_information, + "!

Model Segment Fields

+ "! Model segment fields + model_segment_fields TYPE STANDARD TABLE OF ty_segment_field WITH DEFAULT KEY, + "!

Model Prompt Templates

+ "! Model prompt templates + model_prompt_templates TYPE STANDARD TABLE OF ty_prompt_template WITH DEFAULT KEY, + END OF ty_main. +ENDINTERFACE. diff --git a/file-formats/intm/type/zif_aff_intm_v1.intf.json b/file-formats/intm/type/zif_aff_intm_v1.intf.json new file mode 100644 index 000000000..ceae8db6a --- /dev/null +++ b/file-formats/intm/type/zif_aff_intm_v1.intf.json @@ -0,0 +1,7 @@ +{ + "formatVersion": "1", + "header": { + "description": "Intelligent Scenario Model (INTM)", + "originalLanguage": "en" + } +}