Hi all,
I have been working on this for a couple of days now and I hope that somebody can point me in the right direction.
Is there a way to tell the function to not run more than once ? It gives the same reply 3 times.
Hi all,
I have been working on this for a couple of days now and I hope that somebody can point me in the right direction.
Is there a way to tell the function to not run more than once ? It gives the same reply 3 times.
You need to include the fact that the function call was successfully ran back into the prompt messages, you can do this by including the reply the function returned or just using a placeholder that says “Function successfully performed” otherwise the model will try to call the function again.
I know I did add it there with the tile as function.
But I will try the “successfully worked”
Thank you
If you rely on some of the output generated by the model for the function call later, then you should include that in the successful message, if you don’t then it should be fine as is.
Will look into that. I should have asked earlier
Spent two days on this
Does it need to be the last prompt?
or I can do it like this ?
{ role: “user”, content: inputText },
{ role: “function”, content: “Function successfully performed” },
{
role: “assistant”,
content: responseText,
},
Yes, you can use the python .append function to just add new roles and message content to the messages list, append the users question and the models answer to it, and repeat that in a loop, you can see this thread for further guidance.