Skip to content
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

feat: convert agent prompts into structured Jinja2 templates #3360

Merged
merged 18 commits into from
Aug 18, 2024

Conversation

xingyaoww
Copy link
Contributor

@xingyaoww xingyaoww commented Aug 13, 2024

What is the problem that this fixes or functionality that this introduces? Does it fix any open issues?

This is part of the new micro-agent proposal: #3444


Give a summary of what the PR does, explaining any non-trivial design decisions

  • Refactor CodeAct prompt using Jinja2 template.
  • Implement PromptManager that takes in a prompt directory, agentskill documentations, and optionally a micro-agent name. It will use Jinja2 template to generate the system message and first user message for CodeAct agent. See [Agent Framework] New microagents implementation #3444 for more details.
  • I removed the Github related prompt from the prompt, as i imagine we will implement these into a Github-specialized micro agent.
  • Bump CodeAct version to 1.9 since this is significant prompt change.

Other references

@xingyaoww xingyaoww marked this pull request as ready for review August 18, 2024 00:54
@xingyaoww xingyaoww requested review from neubig, enyst, tobitege, li-boxuan and rbren and removed request for enyst August 18, 2024 01:46
Copy link
Collaborator

@tobitege tobitege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff! LGTM

agenthub/codeact_agent/system_prompt.j2 Outdated Show resolved Hide resolved
agenthub/codeact_agent/user_prompt.j2 Show resolved Hide resolved
@xingyaoww xingyaoww enabled auto-merge (squash) August 18, 2024 15:41
CREDITS.md Outdated Show resolved Hide resolved
Co-authored-by: Engel Nyst <[email protected]>
@xingyaoww xingyaoww enabled auto-merge (squash) August 18, 2024 15:53


class CodeActAgent(Agent):
VERSION = '1.8'
VERSION = '1.9'
Copy link
Collaborator

@enyst enyst Aug 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note, it's not obvious to me from the diff (looking on GitHub) that the prompt as sent to the llm really did change. But 1.9 is ok anyway, it's probably overdue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it did change, though not a lot.

@enyst
Copy link
Collaborator

enyst commented Aug 18, 2024

This looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants