feat: Implement LLM-Powered Adaptive Replay and Auto-Documentation #954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces an LLM-powered adaptive replay strategy and an auto-documentation feature.
Key changes include:
LLMAdaptiveStrategy(openadapt/strategies/llm_adaptive_strategy.py):BaseReplayStrategy.generate_action_event.j2prompt) to determine the next action based on recorded actions, current UI state, and your task description._is_ui_consistent_for_next_original_action) to decide whether to replay a recorded action directly or use the LLM for adaptation if the UI has changed. This involves comparing window titles, dimensions, and screenshot similarity.runmethod to include a post-action check usingprompt_is_action_complete. If an action doesn't complete as expected, this is logged, and I implicitly handle the new state in the next cycle.self.action_events.Auto-Documentation Script (
openadapt/scripts/generate_documentation.py):describe_recording.j2prompt to ask an LLM to generate a human-readable summary of the recording.Integration & Prompts:
generate_action_event.j2,describe_recording.j2,is_action_complete.j2,system.j2) are utilized.Steps I Took:
LLMAdaptiveStrategyclass structure.get_next_action_event.runmethod.generate_documentation.pyscript for auto-documentation.This work fulfills the core requirements of the issue to create an intelligent replay system using LLMs to generalize, abstract, and execute workflows across varying UI states, and to auto-document recordings. I planned unit tests as the next step.
to run , we need to use