Skip to content

Commit

Permalink
feat: improve system and final user prompt for agentic workflow (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuvic committed Apr 2, 2024
1 parent 53730e0 commit 575558b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lua/codecompanion/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ M.static.actions = {
:workflow({
{
role = "system",
content = "You are an expert coder and helpful assistant who can help outline, draft, consider and revise code for the "
content = "You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so. Always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question. Don't be verbose in your answers, but do provide details and examples where it might help the explanation. You are an expert software engineer for the "
.. context.filetype
.. " language.",
start = true,
Expand Down Expand Up @@ -339,12 +339,7 @@ M.static.actions = {
},
{
role = "user",
content = "Thanks. Now let's revise the code based on the feedback.",
auto_submit = true,
},
{
role = "user",
content = "For clarity, can you show the final code without any explanations?",
content = "Thanks. Now let's revise the code based on the feedback, without additional explanations.",
auto_submit = true,
},
})
Expand All @@ -362,7 +357,7 @@ M.static.actions = {
:workflow({
{
role = "system",
content = "You are an expert coder and helpful assistant who can help outline, draft, consider and revise code for the "
content = "You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so. Always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question. Don't be verbose in your answers, but do provide details and examples where it might help the explanation. You are an expert software engineer for the "
.. context.filetype
.. " language.",
start = true,
Expand Down Expand Up @@ -393,12 +388,7 @@ M.static.actions = {
},
{
role = "user",
content = "Thanks. Now let's revise the code based on the feedback.",
auto_submit = true,
},
{
role = "user",
content = "For clarity, can you show the final code without any explanations?",
content = "Thanks. Now let's revise the code based on the feedback, without additional explanations.",
auto_submit = true,
},
})
Expand Down

0 comments on commit 575558b

Please sign in to comment.