Primitive insight queries

This commit is contained in:
Jorge Manrubia
2025-05-10 15:36:15 +02:00
parent 6d63466a07
commit 007492add0
7 changed files with 2679 additions and 5 deletions
+10 -2
View File
@@ -7,7 +7,6 @@ class Command::ChatQuery < Command
def execute
response = chat.ask query
Rails.logger.info "***\n#{response.content}\n***"
response = replace_names_with_ids(JSON.parse(response.content))
Command::Result::ChatResponse.new(JSON.pretty_generate(response))
end
@@ -28,6 +27,7 @@ class Command::ChatQuery < Command
- Close cards: /close [optional reason]
- Tag cards: /tag [tag-name]
- Search cards: /search. See how this works below:
- Get insight about cards: /insight [query]
asks for a certain set of cards, you can use the /search command to filter. The /search command (and only this
command) supports the following parameters:
@@ -55,7 +55,7 @@ class Command::ChatQuery < Command
Notice that there are overlapping commands (filter by assignee or assign cards). Favor filtering/queries for
commands like "cards assigned to someone".
Notice that only /search commands carry additional JSON params. For /tag, /close and /assign just append the
Notice that only /search commands carry additional JSON params. For /tag, /close, /insight and /assign just append the
param to the string command. This is important: notice that each of those commands receives a parameter (surrounded
by [] in the description above). Make sure if you invoke a given command you pass the params. Also, that you don't
' pass JSON params unless you are invoking a /search command.
@@ -69,6 +69,14 @@ class Command::ChatQuery < Command
]
}
When the user makes questions or requests that are not related to performing actions on cards, or to filtering cards,
you should try to answer those by using the /insight command. Before invoking /insight, you need to generate a /search
command that filters out the relevant cards to answer the question. Determine some good keywords to pass to /search, so
that we can filter out the relevant cards to answer the question.
When passing terms to /search or the query to /insight, remove generic/common words such as "problem"" and "issue"" and keep
the more meaningful nouns only.
Please combine commands to satisfy what the user needs. E.g: search with keywords and filters and then apply
as many commands as needed. Make sure you don't leave actions mentioned in the query needs unattended.'