220 lines
6.1 KiB
JSON
220 lines
6.1 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$comment": "SAP AI Core Orchestration Workflow Template",
|
|
|
|
"basic_chat_completion": {
|
|
"config": {
|
|
"module_configurations": {
|
|
"llm_module_config": {
|
|
"model_name": "gpt-4o",
|
|
"model_version": "latest",
|
|
"model_params": {
|
|
"max_tokens": 1000,
|
|
"temperature": 0.7
|
|
}
|
|
},
|
|
"templating_module_config": {
|
|
"template": [
|
|
{"role": "system", "content": "You are a helpful assistant."},
|
|
{"role": "user", "content": "{{?user_message}}"}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"input_params": {
|
|
"user_message": "Hello, how can you help me?"
|
|
}
|
|
},
|
|
|
|
"with_content_filtering": {
|
|
"config": {
|
|
"module_configurations": {
|
|
"llm_module_config": {
|
|
"model_name": "gpt-4o",
|
|
"model_version": "latest"
|
|
},
|
|
"templating_module_config": {
|
|
"template": [
|
|
{"role": "user", "content": "{{?user_message}}"}
|
|
]
|
|
},
|
|
"filtering_module_config": {
|
|
"input": {
|
|
"filters": [
|
|
{
|
|
"type": "azure_content_safety",
|
|
"config": {
|
|
"Hate": 2,
|
|
"Violence": 2,
|
|
"Sexual": 2,
|
|
"SelfHarm": 2
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"output": {
|
|
"filters": [
|
|
{
|
|
"type": "azure_content_safety",
|
|
"config": {
|
|
"Hate": 0,
|
|
"Violence": 0,
|
|
"Sexual": 0,
|
|
"SelfHarm": 0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
"with_data_masking": {
|
|
"config": {
|
|
"module_configurations": {
|
|
"llm_module_config": {
|
|
"model_name": "gpt-4o",
|
|
"model_version": "latest"
|
|
},
|
|
"templating_module_config": {
|
|
"template": [
|
|
{"role": "user", "content": "{{?user_message}}"}
|
|
]
|
|
},
|
|
"masking_module_config": {
|
|
"masking_providers": [
|
|
{
|
|
"type": "sap_data_privacy_integration",
|
|
"method": "pseudonymization",
|
|
"entities": [
|
|
{"type": "profile-person"},
|
|
{"type": "profile-email"},
|
|
{"type": "profile-phone"},
|
|
{"type": "profile-credit-card-number"}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
"with_grounding_rag": {
|
|
"config": {
|
|
"module_configurations": {
|
|
"grounding_module_config": {
|
|
"grounding_service": "document_grounding_service",
|
|
"grounding_service_configuration": {
|
|
"grounding_input_parameters": ["user_query"],
|
|
"grounding_output_parameter": "context",
|
|
"filters": [
|
|
{
|
|
"id": "<your-pipeline-id>",
|
|
"search_configuration": {
|
|
"max_chunk_count": 5
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"llm_module_config": {
|
|
"model_name": "gpt-4o",
|
|
"model_version": "latest"
|
|
},
|
|
"templating_module_config": {
|
|
"template": [
|
|
{
|
|
"role": "system",
|
|
"content": "Answer questions based only on the following context:\n\n{{$context}}\n\nIf the answer is not in the context, say you don't know."
|
|
},
|
|
{"role": "user", "content": "{{?user_query}}"}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"input_params": {
|
|
"user_query": "What is the vacation policy?"
|
|
}
|
|
},
|
|
|
|
"full_enterprise_workflow": {
|
|
"config": {
|
|
"module_configurations": {
|
|
"grounding_module_config": {
|
|
"grounding_service": "document_grounding_service",
|
|
"grounding_service_configuration": {
|
|
"grounding_input_parameters": ["user_query"],
|
|
"grounding_output_parameter": "context",
|
|
"filters": [{"id": "<pipeline-id>"}]
|
|
}
|
|
},
|
|
"templating_module_config": {
|
|
"template": [
|
|
{"role": "system", "content": "You are a helpful enterprise assistant. Use the following context:\n{{$context}}"},
|
|
{"role": "user", "content": "{{?user_query}}"}
|
|
]
|
|
},
|
|
"translation_module_config": {
|
|
"input": {"source_language": "auto", "target_language": "en"},
|
|
"output": {"source_language": "en", "target_language": "auto"}
|
|
},
|
|
"masking_module_config": {
|
|
"masking_providers": [{
|
|
"type": "sap_data_privacy_integration",
|
|
"method": "pseudonymization",
|
|
"entities": [
|
|
{"type": "profile-person"},
|
|
{"type": "profile-email"},
|
|
{"type": "profile-phone"}
|
|
]
|
|
}]
|
|
},
|
|
"filtering_module_config": {
|
|
"input": {
|
|
"filters": [{
|
|
"type": "azure_content_safety",
|
|
"config": {"Hate": 2, "Violence": 2, "Sexual": 2, "SelfHarm": 2}
|
|
}]
|
|
},
|
|
"output": {
|
|
"filters": [{
|
|
"type": "azure_content_safety",
|
|
"config": {"Hate": 0, "Violence": 0, "Sexual": 0, "SelfHarm": 0}
|
|
}]
|
|
}
|
|
},
|
|
"llm_module_config": {
|
|
"model_name": "gpt-4o",
|
|
"model_version": "latest",
|
|
"model_params": {
|
|
"max_tokens": 2000,
|
|
"temperature": 0.5
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
"_documentation": {
|
|
"module_execution_order": [
|
|
"1. Grounding",
|
|
"2. Templating (mandatory)",
|
|
"3. Input Translation",
|
|
"4. Data Masking",
|
|
"5. Input Filtering",
|
|
"6. Model Configuration (mandatory)",
|
|
"7. Output Filtering",
|
|
"8. Output Translation"
|
|
],
|
|
"placeholder_syntax": {
|
|
"{{?variable}}": "Required input parameter",
|
|
"{{$output}}": "Output from previous module (e.g., grounding)"
|
|
},
|
|
"masking_methods": {
|
|
"anonymization": "Irreversible - MASKED_ENTITY placeholder",
|
|
"pseudonymization": "Reversible - MASKED_ENTITY_ID placeholder"
|
|
}
|
|
}
|
|
}
|