Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 21 additions & 2 deletions DSL/Ruuter.private/rag-search/POST/prompt-configuration/save.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ update_prompt:
id: ${existing_prompt.response.body[0].id}
prompt: ${prompt}
result: update_result
next: return_update_success
next: refresh_llm_cache

insert_prompt:
call: http.post
Expand All @@ -47,6 +47,25 @@ insert_prompt:
body:
prompt: ${prompt}
result: insert_result
next: refresh_llm_cache

refresh_llm_cache:
call: http.post
args:
url: "[#RAG_SEARCH_PROMPT_REFRESH]"
body: {}
result: refresh_result
next: check_operation_type
on_error: handle_refresh_error

handle_refresh_error:
log: "Prompt refresh failed, will use TTL cache fallback"
next: check_operation_type

check_operation_type:
switch:
- condition: "${update_result != null}"
next: return_update_success
next: return_insert_success

return_update_success:
Expand All @@ -55,4 +74,4 @@ return_update_success:

return_insert_success:
return: ${insert_result.response.body[0]}
next: end
next: end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
declaration:
call: declare
version: 0.1
description: "Get custom prompt configuration from database"
method: post
accepts: json
returns: json
namespace: rag-search

get_prompt_configuration:
call: http.get
args:
url: "[#RAG_SEARCH_RESQL]/get-prompt-configuration"
result: prompt_result
next: check_prompt_exists

check_prompt_exists:
switch:
- condition: "${prompt_result.response.body.length > 0}"
next: return_result
next: return_empty

return_result:
return: ${prompt_result.response.body[0]}
next: end

return_empty:
assign:
emptyData: {}
next: return_empty_response

return_empty_response:
return: ${emptyData}
next: end
1 change: 1 addition & 0 deletions constants.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ RAG_SEARCH_PROJECT_LAYER=rag-search
RAG_SEARCH_TIM=http://tim:8085
RAG_SEARCH_CRON_MANAGER=http://cron-manager:9010
RAG_SEARCH_LLM_ORCHESTRATOR=http://llm-orchestration-service:8100/orchestrate
RAG_SEARCH_PROMPT_REFRESH=http://llm-orchestration-service:8100/prompt-config/refresh
DOMAIN=localhost
DB_PASSWORD=dbadmin
Loading
Loading