-
Notifications
You must be signed in to change notification settings - Fork 651
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
Code
RolePlaying
example
#211
Conversation
domain = "Sociology" | ||
meta_dict = {"language": language, "domain": domain} | ||
role_play_session = RolePlaying( | ||
f"{language} Programmer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this in-place prompt engineering should not be here. The cool thing about camel is that it incapsulate all the prompts. So the external API can only enter the parameters and all the prompt engineering happens behind the API. This is for the future rework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
language = "JavaScript" | ||
domain = "Sociology" | ||
meta_dict = {"language": language, "domain": domain} | ||
role_play_session = RolePlaying( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the example. I will update the code for Agents accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
from camel.utils import print_text_animated | ||
|
||
|
||
def main(model_type=None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also put main into tests/CI since you have it parametrized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
with_task_specify=True, | ||
model_type=model_type, | ||
task_type=TaskType.CODE, | ||
extend_sys_msg_meta_dicts=[meta_dict, meta_dict], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too complicated as an API. Very unintuitive. We need to segregate prompt engineering of AI society and Code from the dialogue algorithm of RolePlaying. I would create an instance of RolePair into the constructor of RolePlaying. AISocietyRoles and CodeRoles are the concrete classes inherited from RolePair. TDYT @lightaime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right place to apply dependency inversion to disentangle {AISocietyRoles and CodeRoles} from RolePlaying via the interface RolePair.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RolePair may not be accurate. They are the keywords in the prompts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I do not understand your point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good
Description
Add an example of using
RolePlaying
forCode
task.Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!