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

Dynamic Prompting #98

Merged
merged 59 commits into from
Feb 11, 2024
Merged

Dynamic Prompting #98

merged 59 commits into from
Feb 11, 2024

Conversation

Yiannis128
Copy link
Collaborator

Add dynamic prompting into ESBMC-AI. Dynamic Prompting dramatically increases the performance of FCM by using a different prompt for each type of vulnerability. Dynamic Prompting can be configured in the Config by using Scenarios. Scenarios is a list in generate_solution.

Changes

  • Allow for scenarios (different conversations based on the error) to be loaded from the config file. Also added support for them in BaseChatInterface. BaseChatInterface also removed protected messages, since they are hard to maintain when adding/removing features to the class.
  • Built in system messages were also removed, since they are now fully read from the config file. Having them built in is not maintainable, and never planned to keep it this way.
  • FixCodeCommand now resolves the correct scenario from esbmc_output, and passes the correct ChatPromptSettings to the underlying chat interface.
  • UserChat has been adapted to use AIAgentConversation along with template values. All built in messages stack pushes were removed in favor of loading them from config.
  • Config file now has scenarios that are loaded by ESBMC-AI.

* Added scenario support for generate_solution.
* Moved built in conversations into the config. They are going to be removed from code: ie. set_solution.
* Added Dynamic Prompts
…stem messages:

Allows for conversations to be loaded from the config file. Also added support for them in BaseChatInterface. BaseChatInterface also removed protected messages, since they are hard to maintain when adding/removing features to the class.

Built in system messages were also removed since they are now fully read from the config file. Having them built in is not maintainable and never planned to keep it this way.

SolutionGenerator has added partial support for scenarios. Now need to add parser in the FixCodeCommand that will select the correct scenario system message to use.

UserChat has been adapted to use AIAgentConversation along with template values. All built in messages stack pushes were removed in favor of loading them from config.
@Yiannis128
Copy link
Collaborator Author

Tests are not passing. Linting is not passing either.

@Yiannis128 Yiannis128 linked an issue Jan 20, 2024 that may be closed by this pull request
2 tasks
@Yiannis128
Copy link
Collaborator Author

There is a bug when AIModel.apply_chat_template is called and the messages contain non f-string content that has curly braces such as code. This should be fixed because it crashes ESBMC-AI.

@Yiannis128 Yiannis128 linked an issue Feb 3, 2024 that may be closed by this pull request
@Yiannis128 Yiannis128 mentioned this pull request Feb 3, 2024
This was linked to issues Feb 8, 2024
@Yiannis128 Yiannis128 mentioned this pull request Feb 8, 2024
@Yiannis128 Yiannis128 merged commit dd15533 into master Feb 11, 2024
0 of 4 checks passed
@Yiannis128 Yiannis128 deleted the dynamic-prompt branch February 11, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant