-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
PuterBot-26: Add Guardrails validation to get_completion method in DemoReplayStrategy #33
Conversation
…egy using example rail specification
Thank you for getting the ball rolling on this @Mustaballer! 🙏 Ultimately we want to be able to take the output and convert it into a sequence of
What do you think? Please let me know if anything is unclear! |
@abrichr To clarify, we want to convert the llm output(llm_completion) which is a string into a single InputEvent object(which can contain child InputEvents like a tree data structure in image below) using the guardrails, and return the parent InputEvent which has links to subsequent InputEvents. Also, I'm wondering what an example of the llm_completion text would look like for our purposes, just to have a clearer idea on how to parse and organize the RAIL configuration. Thanks :) |
Great questions!
I think ideally we would not want it to contain children, since the children are mostly just there for historical and debugging purposes. Ultimately what we want is a sequence of
This is up for debate, but I think a useful starting point (and more robust than my earlier suggestion) is something like a json literal that can be parsed into a Python dict, which can then be passed into the
(It's not clear to me whether we want to include the timestamp in the completion since we will likely need to override it.) What do you think? |
@abrichr Thanks for explaining that! So, if I understand correctly, the intention of using guardrails is to organize the raw LLM output into a JSON structure that represents InputEvents. That makes sense to me. Therefore, I plan to use guardrails to create the JSON structure from the raw LLM output, and then parse the JSON into a dict using the method you provided. Please let me know if this is what you had in mind and if you have any feedback or suggestions. Thank you! |
That sounds great as a first step!
Keep in mind we may also want to compress the information somehow, for
example using gists (
#27), or some sort of shorthand.
This is to maximize the amount of relevant information we can fit in the
context window.
…On Tue, Apr 25, 2023 at 4:04 PM Mustafa ***@***.***> wrote:
@abrichr <https://github.com/abrichr> Thanks for explaining that! So, if
I understand correctly, the intention of using guardrails is to organize
the raw LLM output into a JSON structure that represents InputEvents. That
makes sense to me. Therefore, I plan to use guardrails to create the JSON
structure from the raw LLM output, and then parse the JSON into a
dictionary using the method you provided.
Please let me know if this is what you had in mind and if you have any
feedback or suggestions. Thank you!
—
Reply to this email directly, view it on GitHub
<#33 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF5DV7RH64TV4AVEIWDSGLXDAU4FANCNFSM6AAAAAAXIXZG2M>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…d custom parser for llm output, and play input events
Excellent work @Mustaballer !
Please do! What should we test?
Exactly right.
Can you please clarify? What is next here? What do you think about this as an MVP:
|
Also since this is such a great example, let's add step by step instructions for checking out and testing, and generating related screenshots (and code for reproducing them*) to the PR description and/or README.md, e.g.
*Ideally a single line e.g. |
@Mustaballer upon attempting to run
Can you please rebase your changes onto the latest changes in
Thank you! 🙏 |
@abrichr Thanks for the feedback. I will rebase my changes in main :) rn |
Thank you @Mustaballer ! This is what I get when I check out your latest changes and run
Any ideas? |
Would you mind trying to run the code again, but this time with a higher value for max_tokens? For instance, you could set it to 300. |
@Mustaballer thank you for the suggestion! Please define all constants at the top of the file in UPPER_SNAKE_CASE, e.g.:
|
@Mustaballer I implemented the following changes and am still getting the same error:
|
@Mustaballer thank you for the great work! Please grab some time on my calendar at your earliest convenience on Weds/Thurs this week: https://www.getclockwise.com/c/richard-abrich/quick-meeting |
@Mustaballer I had a bug in my code that I had to fix. Here's the
Have you gotten this to run? Can you please provide the output of |
Hi @Mustaballer , thanks for the info. What would be required for me to reproduce your results? I think the only thing missing is Can you please try running the linked code as the sender? You can send me the wormhole code via LinkedIn or another side channel. Please feel free to include this code (or a modified version) in your PR as well. (Also please feel free to pick some time today after 2pm for our meeting if that works better for you! 🙏 ) |
@Mustaballer any update on this? |
I had temporarily paused work on this project, but I now plan to conduct additional testing with guardrails. My focus will be on enforcing strict standards for the language model completions. While I will be using the current models initially, I believe there is potential for guardrails to be employed in other replay strategies as well. I will provide a retrospective update on my progress and determine whether it is appropriate to close the project based on the results. |
Closing the pull request because I was unable to achieve the desired outcome while utilizing the "guardrails" library for rigorous parsing of Action Events. |
Overview
Unit Tests Created
Steps to QA
Questions