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
25 changes: 25 additions & 0 deletions DSL/Resql/rag-search/POST/get-testing-connection.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SELECT
id,
connection_name,
used_budget,
monthly_budget,
warn_budget_threshold,
stop_budget_threshold,
environment,
connection_status,
created_at,
llm_platform,
llm_model,
embedding_platform,
embedding_model,
CASE
WHEN used_budget IS NULL OR used_budget = 0 OR (used_budget::DECIMAL / monthly_budget::DECIMAL) < (warn_budget_threshold::DECIMAL / 100.0) THEN 'within_budget'
WHEN stop_budget_threshold != 0 AND (used_budget::DECIMAL / monthly_budget::DECIMAL) >= (stop_budget_threshold::DECIMAL / 100.0) THEN 'over_budget'
WHEN stop_budget_threshold = 0 AND (used_budget::DECIMAL / monthly_budget::DECIMAL) >= 1 THEN 'over_budget'
WHEN (used_budget::DECIMAL / monthly_budget::DECIMAL) >= (warn_budget_threshold::DECIMAL / 100.0) THEN 'close_to_exceed'
ELSE 'within_budget'
END AS budget_status
FROM llm_connections
WHERE environment = 'testing'
ORDER BY created_at DESC
LIMIT 1;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ INSERT INTO inference_results (
embedding_scores,
final_answer,
environment,
llm_connection_id,
created_at
) VALUES (
:chat_id,
Expand All @@ -17,6 +18,7 @@ INSERT INTO inference_results (
:embedding_scores::JSONB,
:final_answer,
:environment,
:llm_connection_id,
:created_at::timestamp with time zone
) RETURNING
id,
Expand All @@ -28,4 +30,5 @@ INSERT INTO inference_results (
embedding_scores,
final_answer,
environment,
llm_connection_id,
created_at;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ declaration:
- field: final_answer
type: string
description: "LLM's final generated answer"
- field: environment
type: string
description: "Environment identifier (e.g., production, testing)"
- field: llm_connection_id
type: string
description: "Connection identifier"

extract_request_data:
assign:
Expand All @@ -39,6 +45,8 @@ extract_request_data:
ranked_chunks: ${JSON.stringify(incoming.body.ranked_chunks) || null}
embedding_scores: ${JSON.stringify(incoming.body.embedding_scores) || null}
final_answer: ${incoming.body.final_answer}
environment: ${incoming.body.environment}
llm_connection_id: ${incoming.body.llm_connection_id}
created_at: ${new Date().toISOString()}
next: validate_required_fields

Expand All @@ -51,7 +59,7 @@ validate_required_fields:
store_production_inference_result:
call: http.post
args:
url: "[#RAG_SEARCH_RESQL]/store-production-inference-result"
url: "[#RAG_SEARCH_RESQL]/store-inference-result"
body:
chat_id: ${chat_id}
user_question: ${user_question}
Expand All @@ -60,7 +68,8 @@ store_production_inference_result:
ranked_chunks: ${ranked_chunks}
embedding_scores: ${embedding_scores}
final_answer: ${final_answer}
environment: "production"
environment: ${environment}
llm_connection_id: ${llm_connection_id}
created_at: ${created_at}
result: store_result
next: check_status
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.llm_orchestration_service
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN uv sync --locked
EXPOSE 8100

# Run the FastAPI app via uvicorn
CMD ["uv","run","uvicorn", "src.llm_orchestration_service_api:app", "--host", "0.0.0.0", "--port", "8100"]
CMD ["uv","run","uvicorn", "src.llm_orchestration_service_api:app", "--host", "0.0.0.0", "--port", "8100"]
Loading
Loading