Skip to content

Commit ed26c07

Browse files
author
erangi-ar
committed
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into intents-db-schema
2 parents bcb3437 + d1d8733 commit ed26c07

File tree

14 files changed

+1152
-61
lines changed

14 files changed

+1152
-61
lines changed

DSL/Ruuter.private/rag-search/POST/prompt-configuration/save.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ update_prompt:
3838
id: ${existing_prompt.response.body[0].id}
3939
prompt: ${prompt}
4040
result: update_result
41-
next: return_update_success
41+
next: refresh_llm_cache
4242

4343
insert_prompt:
4444
call: http.post
@@ -47,6 +47,25 @@ insert_prompt:
4747
body:
4848
prompt: ${prompt}
4949
result: insert_result
50+
next: refresh_llm_cache
51+
52+
refresh_llm_cache:
53+
call: http.post
54+
args:
55+
url: "[#RAG_SEARCH_PROMPT_REFRESH]"
56+
body: {}
57+
result: refresh_result
58+
next: check_operation_type
59+
on_error: handle_refresh_error
60+
61+
handle_refresh_error:
62+
log: "Prompt refresh failed, will use TTL cache fallback"
63+
next: check_operation_type
64+
65+
check_operation_type:
66+
switch:
67+
- condition: "${update_result != null}"
68+
next: return_update_success
5069
next: return_insert_success
5170

5271
return_update_success:
@@ -55,4 +74,4 @@ return_update_success:
5574

5675
return_insert_success:
5776
return: ${insert_result.response.body[0]}
58-
next: end
77+
next: end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
declaration:
2+
call: declare
3+
version: 0.1
4+
description: "Get custom prompt configuration from database"
5+
method: post
6+
accepts: json
7+
returns: json
8+
namespace: rag-search
9+
10+
get_prompt_configuration:
11+
call: http.get
12+
args:
13+
url: "[#RAG_SEARCH_RESQL]/get-prompt-configuration"
14+
result: prompt_result
15+
next: check_prompt_exists
16+
17+
check_prompt_exists:
18+
switch:
19+
- condition: "${prompt_result.response.body.length > 0}"
20+
next: return_result
21+
next: return_empty
22+
23+
return_result:
24+
return: ${prompt_result.response.body[0]}
25+
next: end
26+
27+
return_empty:
28+
assign:
29+
emptyData: {}
30+
next: return_empty_response
31+
32+
return_empty_response:
33+
return: ${emptyData}
34+
next: end

constants.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ RAG_SEARCH_PROJECT_LAYER=rag-search
77
RAG_SEARCH_TIM=http://tim:8085
88
RAG_SEARCH_CRON_MANAGER=http://cron-manager:9010
99
RAG_SEARCH_LLM_ORCHESTRATOR=http://llm-orchestration-service:8100/orchestrate
10+
RAG_SEARCH_PROMPT_REFRESH=http://llm-orchestration-service:8100/prompt-config/refresh
1011
DOMAIN=localhost
1112
DB_PASSWORD=dbadmin

0 commit comments

Comments
 (0)