Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INTM] Add new object type INTM #671

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions file-formats/intm/README.md
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# INTM File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.intm.json` | 1 | [`zif_aff_intm_v1.intf.abap`](./type/zif_aff_intm_v1.intf.abap) | [`intm-v1.json`](./intm-v1.json) | [`sapq0lic8p8o65ew6afk3aen3gp3.intm.json`](./examples/sapq0lic8p8o65ew6afk3aen3gp3.intm.json)
35 changes: 35 additions & 0 deletions file-formats/intm/examples/sapq0lic8p8o65ew6afk3aen3gp3.intm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"formatVersion": "1",
"header": {
"description": "Model creation test via ADT",
"originalLanguage": "en"
},
"intelligentScenarioModel": {
"modelName": "RM_TEST_ADT_964_MOD",
"intelligentScenario": "RM_TEST_ADT_964",
"modellingContextId": "CFFE69A6585C4DFB6846A4C003FDCFE2",
"modelType": "SAPGENAI",
"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. \n\nThe subject of email should be of format <Confirmation on order number: {order_number} placed on {booking_date}> \nThe body of email should be of format: \"\"\"\"SO contains <Category> to be delivered to <Location>. And will be delivered via a <size> vehicle. \nIF <distance between source address and delivery address> > 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
}
]
}
233 changes: 233 additions & 0 deletions file-formats/intm/intm-v1.json
Original file line number Diff line number Diff line change
@@ -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 Models",
"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"
]
},
"intelligentScenarioModel": {
"title": "Intelligent Scenario Model",
"description": "Intelligent scenario model",
"type": "object",
"properties": {
"modelName": {
"title": "Model Name",
"description": "Model name",
"type": "string",
"maxLength": 30
},
"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
},
"modelType": {
"title": "Model Type",
"description": "Model type",
"type": "string",
"maxLength": 256
},
"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": "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",
"intelligentScenarioModel"
]
}
111 changes: 111 additions & 0 deletions file-formats/intm/type/zif_aff_intm_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
INTERFACE zif_aff_intm_v1
PUBLIC.

TYPES:
"! <p class="shorttext">Intelligent Scenario Model</p>
"! Intelligent scenario model
BEGIN OF ty_intelligent_scenario_model,
"! <p class="shorttext">Model Name</p>
"! Model name
model_name TYPE c LENGTH 30,
"! <p class="shorttext">Intelligent Scenario</p>
"! Intelligent scenario of the model
intelligent_scenario TYPE c LENGTH 20,
"! <p class="shorttext">Modelling Context ID</p>
"! Modelling context ID which is the parent of the model
modelling_context_id TYPE c LENGTH 36,
"! <p class="shorttext">Model Type</p>
"! Model type
model_type TYPE c LENGTH 256,
"! <p class="shorttext">Adapter ID</p>
"! Adapter ID
adapter_id TYPE c LENGTH 32,
"! <p class="shorttext">Native Model Type</p>
"! Native model type
native_model_type TYPE c LENGTH 256,
"! <p class="shorttext">Model Specification</p>
"! Model specification
model_specification TYPE string,
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Model Definition</p>
"! Model definition
model_definition TYPE string,
"! <p class="shorttext">State</p>
"! State of the model
state TYPE c LENGTH 10,
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Signature</p>
"! Model signature
signature TYPE string,
"! <p class="shorttext">Bindings</p>
"! Model bindings
bindings TYPE string,
"! <p class="shorttext">Is Enhancement</p>
"! If true, the model is an enhancement, if false the model is a new model.
is_enhancement TYPE abap_bool,
"! <p class="shorttext">Executable ID</p>
"! Executable ID
executable_id TYPE c LENGTH 64,
"! <p class="shorttext">Large Language Model Name</p>
"! Large language model name
llm_name TYPE string,
"! <p class="shorttext">Large Language Model Version</p>
"! Large language model version
llm_version TYPE c LENGTH 30,
END OF ty_intelligent_scenario_model,

"! <p class="shorttext">Segment Field</p>
"! Model segment field
BEGIN OF ty_segment_field,
"! <p class="shorttext">Field Name</p>
"! Table or view field name
field_name TYPE c LENGTH 30,
"! <p class="shorttext">Position</p>
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
"! Field position
field_position TYPE i,
schneidermic0 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Is Key Field</p>
"! If true, the field is a key field
is_key TYPE abap_bool,
END OF ty_segment_field,

"! <p class="shorttext">Model Prompt Template</p>
"! Model prompt template
BEGIN OF ty_prompt_template,
"! <p class="shorttext">Prompt Template Name</p>
"! Prompt template name
"! $required
prompt_template_name TYPE c LENGTH 30,
"! <p class="shorttext">Prompt Template Description</p>
"! Description of prompt template
prompt_template_description TYPE string,
"! <p class="shorttext">Prompt</p>
"! Prompt
"! $required
prompt TYPE string,
"! <p class="shorttext">Prompt Parameters</p>
"! Prompt parameters
prompt_parameters TYPE string,
"! <p class="shorttext">Prompt Visibility</p>
"! If true, the prompt is visible
is_visible TYPE abap_bool,
END OF ty_prompt_template,

"! <p class="shorttext">Intelligent scenario Models</p>
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
"! Intelligent scenario model
BEGIN OF ty_main,
"! $required
format_version TYPE zif_aff_types_v1=>ty_format_version,
"! <p class="shorttext">Header</p>
"! Header
"! $required
header TYPE zif_aff_types_v1=>ty_header_60,
"! <p class="shorttext">Intelligent Scenario Model</p>
"! Intelligent scenario model
"! $required
intelligent_scenario_model TYPE ty_intelligent_scenario_model,
"! <p class="shorttext">Model Segment Fields</p>
"! Model segment fields
model_segment_fields TYPE STANDARD TABLE OF ty_segment_field WITH DEFAULT KEY,
"! <p class="shorttext">Model Prompt Templates</p>
"! Model prompt templates
model_prompt_templates TYPE STANDARD TABLE OF ty_prompt_template WITH DEFAULT KEY,
END OF ty_main.
ENDINTERFACE.
7 changes: 7 additions & 0 deletions file-formats/intm/type/zif_aff_intm_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "General types reusable in AFF",
raghav6686 marked this conversation as resolved.
Show resolved Hide resolved
"originalLanguage": "en"
}
}
Loading