generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: [Orchestration] Extend Grounding Unit Test (#281)
* Extend unit test and add sample request json * Minor - check false report * Fix typo * Extend test to use additional model classes --------- Co-authored-by: Roshin Rajan Panackal <roshin.rajan.panackal@sap.com>
- Loading branch information
Showing
3 changed files
with
139 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 20 additions & 20 deletions
40
orchestration/src/test/resources/__files/groundingResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,62 @@ | ||
{ | ||
"request_id": "0d9d7ce3-9ded-481f-80c6-977e78e2e905", | ||
"request_id": "e5d2add4-408c-4da5-84ca-1d8b0fe350c8", | ||
"module_results": { | ||
"grounding": { | ||
"message": "grounding result", | ||
"data": { | ||
"grounding_query": "grounding call", | ||
"grounding_result": "Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.```It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP’s \u01ee solution portfolio." | ||
"grounding_result": "First chunk```Second chunk```Last found chunk" | ||
} | ||
}, | ||
"templating": [ | ||
{ | ||
"role": "user", | ||
"content": "What does Joule do? Use the following information as additional context: Joule is the AI copilot that truly understands your business. Joule revolutionizes how you interact with your SAP business systems, making every touchpoint count and every task simpler.```It enables the companion of the Intelligent Enterprise, guiding you through content discovery within SAP Ecosystem, and giving a transparent role-based access to the relevant processes from everywhere. This is the one assistant experience, a unified and delightful user experience across SAP’s \u01ee solution portfolio." | ||
"role": "system", | ||
"content": "Context message with embedded grounding results. First chunk```Second chunk```Last found chunk" | ||
} | ||
], | ||
"llm": { | ||
"id": "chatcmpl-AbRlNdsyQJfvBINnw3MOTP77WSE4X", | ||
"id": "chatcmpl-Apz5s3CMf99jkOnxvPshH1rGLwvvU", | ||
"object": "chat.completion", | ||
"created": 1733488221, | ||
"model": "gpt-35-turbo", | ||
"system_fingerprint": "fp_808245b034", | ||
"created": 1736952936, | ||
"model": "gpt-4o-2024-08-06", | ||
"system_fingerprint": "fp_f3927aa00d", | ||
"choices": [ | ||
{ | ||
"index": 0, | ||
"message": { | ||
"role": "assistant", | ||
"content": "Joule is an AI copilot that revolutionizes how users interact with their SAP business systems. It enables the companion of the Intelligent Enterprise, guiding users through content discovery within the SAP Ecosystem and providing transparent role-based access to relevant processes from anywhere. Joule aims to provide a unified and delightful user experience across SAP's solution portfolio." | ||
"content": "Response that makes uses of grounding results in the context message." | ||
}, | ||
"finish_reason": "stop" | ||
} | ||
], | ||
"usage": { | ||
"completion_tokens": 68, | ||
"prompt_tokens": 113, | ||
"total_tokens": 181 | ||
"completion_tokens": 163, | ||
"prompt_tokens": 217, | ||
"total_tokens": 380 | ||
} | ||
} | ||
}, | ||
"orchestration_result": { | ||
"id": "chatcmpl-AbRlNdsyQJfvBINnw3MOTP77WSE4X", | ||
"id": "chatcmpl-Apz5s3CMf99jkOnxvPshH1rGLwvvU", | ||
"object": "chat.completion", | ||
"created": 1733488221, | ||
"model": "gpt-35-turbo", | ||
"system_fingerprint": "fp_808245b034", | ||
"created": 1736952936, | ||
"model": "gpt-4o-2024-08-06", | ||
"system_fingerprint": "fp_f3927aa00d", | ||
"choices": [ | ||
{ | ||
"index": 0, | ||
"message": { | ||
"role": "assistant", | ||
"content": "Joule is an AI copilot that revolutionizes how users interact with their SAP business systems. It enables the companion of the Intelligent Enterprise, guiding users through content discovery within the SAP Ecosystem and providing transparent role-based access to relevant processes from anywhere. Joule aims to provide a unified and delightful user experience across SAP's solution portfolio." | ||
"content": "Response that makes uses of grounding results in the context message." | ||
}, | ||
"finish_reason": "stop" | ||
} | ||
], | ||
"usage": { | ||
"completion_tokens": 68, | ||
"prompt_tokens": 113, | ||
"total_tokens": 181 | ||
"completion_tokens": 163, | ||
"prompt_tokens": 217, | ||
"total_tokens": 380 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"orchestration_config" : { | ||
"module_configurations" : { | ||
"llm_module_config" : { | ||
"model_name" : "gpt-35-turbo-16k", | ||
"model_params" : { | ||
"max_tokens" : 50, | ||
"temperature" : 0.1, | ||
"frequency_penalty" : 0, | ||
"presence_penalty" : 0, | ||
"top_p" : 1, | ||
"n" : 1 | ||
}, | ||
"model_version" : "latest" | ||
}, | ||
"templating_module_config" : { | ||
"template" : [ { | ||
"role" : "system", | ||
"content" : "Context message with embedded grounding results. {{?results}}" | ||
} ] | ||
}, | ||
"grounding_module_config" : { | ||
"type" : "document_grounding_service", | ||
"config" : { | ||
"filters" : [ { | ||
"id" : "arbitrary-user-defined-id", | ||
"search_config" : { | ||
"max_chunk_count" : 3 | ||
}, | ||
"data_repositories" : [ "*" ], | ||
"data_repository_type" : "vector", | ||
"data_repository_metadata" : [ ], | ||
"document_metadata" : [ { | ||
"key" : "document metadata", | ||
"value" : [ "2" ], | ||
"select_mode" : [ "ignoreIfKeyAbsent" ] | ||
} ], | ||
"chunk_metadata" : [ { | ||
"key" : "chunk metadata", | ||
"value" : [ "1" ] | ||
} ] | ||
} ], | ||
"input_params" : [ "query" ], | ||
"output_param" : "results" | ||
} | ||
} | ||
}, | ||
"stream" : false | ||
}, | ||
"input_params" : { | ||
"query" : "String used for similarity search in database" | ||
}, | ||
"messages_history" : [ ] | ||
} |