Rework prompt to make it less ambiguous and better overall

This commit is contained in:
Jorge Manrubia
2025-07-18 05:11:08 +02:00
parent 1486392b6b
commit b30bc85f4e
28 changed files with 194014 additions and 32 deletions
+8 -8
View File
@@ -7,15 +7,15 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
@user = users(:david)
end
vcr_record!
test "filter by assignments" do
# List context
assert_command({ context: { assignee_ids: [ "jz" ] } }, "cards assigned to jz")
assert_command({ context: { assignee_ids: [ "kevin" ] } }, "stuff assigned to kevin")
assert_command({ context: { assignee_ids: [ "jz" ] } }, "assigned to jz")
assert_command({ context: { assignment_status: "unassigned" } }, "unassigned cards")
assert_command({ context: { assignment_status: "unassigned" } }, "not assigned")
assert_command({ context: { assignee_ids: [ "jorge" ], terms: [ "performance" ] } }, "cards about performance assigned to jorge")
assert_command({ context: {assignee_ids: ["jz"], indexed_by: "latest"} }, "stuff that jz has done lately")
# Card context
assert_command({ context: { assignee_ids: [ "jz" ] } }, "cards assigned to jz", context: :card)
@@ -47,7 +47,7 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
test "filter by card id" do
assert_command({ context: { card_ids: [ 123 ] } }, "card 123")
assert_command({ context: { card_ids: [ 123, 456 ] } }, "card 123, 456")
assert_command({ context: { terms: [ "123" ] } }, "123") # Notice existing cards will be intercepted earlier
assert_command({ commands: ["/search 123"] }, "123") # Notice existing cards will be intercepted earlier
end
test "filter by time ranges" do
@@ -141,7 +141,7 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
test "default to search" do
assert_command({ commands: [ "/search backups" ] }, "backups")
assert_command({ context: { terms: [ "backups" ] } }, "cards about backups")
assert_command({ commands: [ "/search backups" ] }, "cards about backups")
end
test "combine commands and filters" do
@@ -149,14 +149,14 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
{ context: { card_ids: [ 176, 170 ] }, commands: [ "/do", "/assign #{users(:david).to_gid}", "/stage Investigating" ] },
"Move 176 and 170 to doing, assign to me and set the stage to Investigating")
assert_command(
{ context: { assignee_ids: [ "jz" ], tag_ids: [ "design" ] }, commands: [ "/assign andy", "/tag v2" ] },
"assign andy to the current #design cards assigned to jz and tag them with #v2")
{ context: { tag_ids: [ "design" ] }, commands: [ "/assign andy", "/tag #v2" ] },
"assign andy to the current #design cards and tag them with #v2")
assert_command(
{ context: { assignee_ids: [ "andy" ] }, commands: [ "/close", "/assign kevin" ] },
"close cards assigned to andy and assign them to kevin")
assert_command(
{ context: { tag_ids: [ "design" ], assignee_ids: [ "jz" ] }, commands: [ "/assign andy", "/tag v2" ] },
"assign cards tagged with #design assigned to jz to andy and tag them with #v2")
{ context: { tag_ids: [ "design" ] }, commands: [ "/assign andy", "/tag #v2" ] },
"assign cards tagged with #design to andy and tag them with #v2")
end
private
+1 -1
View File
@@ -22,6 +22,6 @@ class Command::GoToCardTest < ActionDispatch::IntegrationTest
result = command.execute
assert_equal 1, result.size
assert_equal cards_path(terms: [ "123" ]), result.first.url
assert_equal search_path(q: "123"), result.first.url
end
end