Skip to content
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

refactor(agents-api): Refactor context.model_dump() to be more lightweight #824

Merged
merged 2 commits into from
Nov 10, 2024

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented Nov 10, 2024

Signed-off-by: Diwank Singh Tomer [email protected]


Important

Refactor context.model_dump() to context.prepare_for_step() across multiple task step files for improved efficiency and add minor logging and type hint updates.

  • Refactoring:
    • Replace context.model_dump() with context.prepare_for_step() in evaluate_step.py, for_each_step.py, if_else_step.py, log_step.py, map_reduce_step.py, prompt_step.py, return_step.py, set_value_step.py, switch_step.py, tool_call_step.py, wait_for_input_step.py, and yield_step.py.
  • Logging:
    • Change logging from logging.error to activity.logger.error in for_each_step.py and map_reduce_step.py.
  • Type Hints:
    • Add beartype type hints to run_task_execution_workflow() in temporal.py.
    • Update type hints for start and previous_inputs in run_task_execution_workflow() to use | None syntax.
  • Miscellaneous:
    • Add prepare_for_step() method in tasks.py to merge execution inputs and current input.

This description was created by Ellipsis for 9bc0f3d. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 9bc0f3d in 41 seconds

More details
  • Looked at 258 lines of code in 14 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. agents-api/agents_api/activities/task_steps/return_step.py:24
  • Draft comment:
    The error message here mistakenly refers to 'log_step'. It should be 'return_step'.
        activity.logger.error(f"Error in return_step: {e}")
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. agents-api/agents_api/activities/task_steps/map_reduce_step.py:27
  • Draft comment:
    Use activity.logger for consistency with other step files.
activity.logger.error(f"Error in map_reduce_step: {e}")
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_wMeQBheANsNlN7gh


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@creatorrr creatorrr merged commit b0995d7 into dev Nov 10, 2024
16 checks passed
@creatorrr creatorrr deleted the r/context-prepare branch November 10, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants