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

Update role_playing_with_function.py #414

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/function_call/role_playing_with_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ def main(model_type=ModelType.GPT_4, chat_turn_limit=10) -> None:
"and get the current weather of the city where KAUST "
"is located.")

user_model_config = ChatGPTConfig(temperature=0.0)

function_list = [*MATH_FUNCS, *SEARCH_FUNCS, *WEATHER_FUNCS]
user_model_config = FunctionCallingConfig.from_openai_function_list(
Copy link
Member

Choose a reason for hiding this comment

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

Hi @zhiyu-01 , still working on the PR? If yes:

  1. Please update the branch and fix the ci/cd
  2. I got your point, you would like to let the user provide better instructions to the assistant about the weather search. However, if you configure it like this, which means that the user can also use the weather API to search for the weather, it does not conform to the user's role setting.
  3. In addition, if you still want to improve it, there is another approach: you can create/add the role description for the user. Here is an example about the role description: https://github.com/camel-ai/camel/blob/master/examples/role_description/role_playing_with_role_description.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I will try the role description.

function_list=function_list,
kwargs=dict(temperature=0.0),
)
assistant_model_config = FunctionCallingConfig.from_openai_function_list(
function_list=function_list,
kwargs=dict(temperature=0.0),
Expand Down
Loading