-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(backend): New "update microagent prompt" API #8357
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
base: main
Are you sure you want to change the base?
Conversation
openhands/server/utils.py
Outdated
A list of events including the target event and the specified number of events before and after it. | ||
""" | ||
target_event_index = None | ||
for i, event in enumerate(events): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the point... Still, we shouldn't need the index in history, only event ids... We could apply a filter like this on get_events
so that it gives us only the kind of events that can be part of an agent's history. Not enough, because we counted events, not agent history events...
OK, better, we can move to Tim's new interface to the event stream, search_events
instead of get_events
, because it also has a limit
argument (and a nicer filter). So we can do something like
search_events (
event_id=...,
filter=EventFilter(...),
limit=context_size
)
and then get those before event_id
similarly, with reverse=True
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if you want me to tweak the events and the prompt. Probably on Monday if that's okay with you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it to search events with the start and end indices, though I'm not sure if this is entirely correct given your comment on filter, limits, and reverse.
If you think there is a better way to do this, feel free! As for the prompt (if you mean the jinja file), yes, any improvements there would be appreciated as well 😄
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like
Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
End-user friendly description of the problem this fixes or functionality this introduces.
Summarize what the PR does, explaining any non-trivial design decisions.
Steps:
Blocks #8592
Link of any specific issues this addresses:
To run this PR locally, use the following command: