-
Notifications
You must be signed in to change notification settings - Fork 3
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
Option to bypass function excecution return msg, only show next TEXT return msg #5
Comments
yeah, this feature has already been planned (in my mind), but maybe it should go after #4 . |
Check |
I followed your example and added an option 'fc_chain' in Session.ask, it does the trick, but may be a bit verbose:
One thing to note here is that, if we only put str(call_ret) in the content, it may enter an infinite loop calling the same function if the call_ret is not clearly expressing a function call "success". After I added the prefix "function successfully called with return value: ", this issue was much relieved. |
"content": f'function successfully called with return value: {str(call_ret)}' "content": f'function successfully called with return value: {str(call_ret)}, please go to next step.' |
CallingGPT/CallingGPT/session/session.py
Lines 49 to 65 in 51f3cd7
These lines of code will now excecute the corresponding function and print out the return value from the function, which is great.
I wonder if we could make a step even further: if a function call is chosen by ChatGPT, we excecute the function, and directly send back a msg to ChatGPT again with an appended msg format like this:
{
"role": "function",
"name": name_of_the_function_excecuted
"content": function_return_value
}
and we only return text reply from ChatGPT for session.ask(). (Possibly, ChatGPT can call multiple functions in a row, and the user only wants the final answer)
The text was updated successfully, but these errors were encountered: