-
Notifications
You must be signed in to change notification settings - Fork 4
Service layer validation in tool classifier #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3020e31
Merge pull request #122 from rootcodelabs/wip
nuwangeek 6e5c22c
remove unwanted file
nuwangeek 38d0533
updated changes
nuwangeek 72b8ae1
fixed requested changes
nuwangeek 9b7bc7b
fixed issue
nuwangeek 46dd6c4
Merge pull request #123 from rootcodelabs/llm-316
nuwangeek 068f4e0
Merge pull request #124 from buerokratt/wip
Thirunayan22 a2084e5
service workflow implementation without calling service endpoints
nuwangeek 5216c09
Merge pull request #126 from rootcodelabs/wip
nuwangeek 864ad30
fixed requested changes
nuwangeek 25f9614
fixed issues
nuwangeek 69c1279
protocol related requested changes
nuwangeek 07f2e0f
fixed requested changes
nuwangeek 6c20b0a
rename mock resql endpoints
nuwangeek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,11 @@ | ||
| -- Count active services for tool classifier | ||
| -- Used by Service Workflow to determine search strategy: | ||
| -- - If count <= 50: Use all services for LLM context | ||
| -- - If count > 50: Use Qdrant semantic search for top 20 | ||
|
|
||
| SELECT | ||
| COUNT(*) AS active_service_count | ||
| FROM | ||
| public.services | ||
| WHERE | ||
| current_state = 'active'; | ||
20 changes: 20 additions & 0 deletions
20
DSL/Resql/rag-search/POST/mock-get-all-active-services.sql
This file contains hidden or 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,20 @@ | ||
| -- Get all active services for intent detection | ||
| -- Used when active_service_count <= 50 | ||
| -- Returns all service metadata needed for LLM intent detection | ||
|
|
||
| SELECT | ||
| service_id, | ||
| name, | ||
| description, | ||
| ruuter_type, | ||
| slot, | ||
| entities, | ||
| examples, | ||
| structure, | ||
| endpoints | ||
| FROM | ||
| public.services | ||
| WHERE | ||
| current_state = 'active' | ||
| ORDER BY | ||
| name ASC; |
This file contains hidden or 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,24 @@ | ||
| -- Get specific service by service_id for validation | ||
| -- Used after LLM detects intent to validate the service exists and is active | ||
| -- Returns all service details needed to trigger the external service call | ||
|
|
||
| SELECT | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also already implemented in service module
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Thirunayan22 Same as above |
||
| id, | ||
| service_id, | ||
| name, | ||
| description, | ||
| ruuter_type, | ||
| current_state, | ||
| is_common, | ||
| slot, | ||
| entities, | ||
| examples, | ||
| structure, | ||
| endpoints, | ||
| created_at, | ||
| updated_at | ||
| FROM | ||
| public.services | ||
| WHERE | ||
| service_id = :serviceId | ||
| AND current_state = 'active'; | ||
60 changes: 60 additions & 0 deletions
60
DSL/Ruuter.public/rag-search/GET/services/get-services.yml
This file contains hidden or 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,60 @@ | ||
| declaration: | ||
| call: declare | ||
| version: 0.1 | ||
| description: "Get services for intent detection - returns all services if count <= 10, otherwise signals to use semantic search" | ||
| method: get | ||
| returns: json | ||
| namespace: rag-search | ||
|
|
||
| # Step 1: Count active services | ||
| count_services: | ||
| call: http.post | ||
| args: | ||
| url: "[#RAG_SEARCH_RESQL]/mock-count-active-services" | ||
| body: {} | ||
| result: count_result | ||
| next: check_service_count | ||
|
|
||
| # Step 2: Check if count > threshold (10) | ||
| check_service_count: | ||
| assign: | ||
| service_count: ${Number(count_result.response.body[0].active_service_count)} | ||
| switch: | ||
| - condition: "${service_count > 10}" | ||
| next: return_semantic_search_flag | ||
| next: fetch_all_services | ||
|
|
||
| # Step 3a: If > 10, return flag for semantic search | ||
| return_semantic_search_flag: | ||
| assign: | ||
| semantic_search_response: | ||
| use_semantic_search: true | ||
| service_count: ${service_count} | ||
| message: "Service count exceeds threshold - use semantic search" | ||
| next: return_semantic_search_response | ||
|
|
||
| return_semantic_search_response: | ||
| return: ${semantic_search_response} | ||
| next: end | ||
|
|
||
| # Step 3b: If <= 10, fetch all services | ||
| fetch_all_services: | ||
| call: http.post | ||
| args: | ||
| url: "[#RAG_SEARCH_RESQL]/mock-get-all-active-services" | ||
| body: {} | ||
| result: services_result | ||
| next: return_all_services | ||
|
|
||
| # Step 4: Return all services for LLM | ||
| return_all_services: | ||
| assign: | ||
| all_services_response: | ||
| use_semantic_search: false | ||
| service_count: ${services_result.response.body.length} | ||
| services: ${services_result.response.body} | ||
| next: return_all_services_response | ||
|
|
||
| return_all_services_response: | ||
| return: ${all_services_response} | ||
| next: end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already implemented in service module right @nuwangeek ? Any reason we are having a resql service here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Thirunayan22 yes since we haven't integrated with service module we need this as mock resql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then can we add a "mock-" prefix just to be clear?