-
Notifications
You must be signed in to change notification settings - Fork 29
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
Return control after function executed #55
Comments
One example of use, I have left commented the original string I was using to return control:
|
@ebarrragn You can use the normal LlamaCppAgent. It will just call the function and returns the result. |
Interesting, I may not understand it correctly. When I use it, depending on the model, they carry on calling functions until they decide to return control (1 to 4 iterations more), or they get into an infinite cycle, I've seen that using 'Phi-3-mini-4k-instruct-q4.gguf'. Am I doing something wrong when the agent doesn't return control after one single function call? EDIT: The reason of the original modification (that I don't mind to keep in an independent patch) is that I am using a step to clean results from a search. 1 - Search (currently in a Qdrant database and on Wikipedia) The creators of queries and receivers of the results are also llama agents. Just to clarify my reasons, as I said, given that the use case might be no so general, I don't mind keeping it as a local patch here. |
@ebarrragn Could you show me your code? I'm curious why this happens. |
Sure, I'll prepare a case example with that part only, so you don't have to grok all over the code. |
Finally, I found some time. After the changes done last weekend, my code is quite broken, will have a look at it this weekend. I adapted one of the examples to show the issue, I just made the llm local using phi3 as model (I hope it's not nonsense) . |
The PHI3 problem seems related to llama.cpp. |
You can simply use the LlamaCppAgent instead of the FunctionCallingAgent to return controll immeadeatly |
Yes, the phi3 bug confused me because even using the LlamaCppAgent, it wasn't stopping, but actually it seems to be a llama.cpp problem. |
I'd like to stop execution after a function has been executed, mostly to save the time taken by another LLM iteration (I have an old P40). Until now, I was telling the agent things like say '(End of message)' or so, but the final response was returned incomplete.
Looking into the code, it turns out there is a commentary talking about a 'return_control' flag that seems not implemented (correct me if I am wrong).
I have implemented it in function_calling_agent.py, line 396, method generate_response, just before the line
if agent_sent_message:
:I can try a pull request if that is fine.
The text was updated successfully, but these errors were encountered: