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

fix(agents-api): Switch to monkeypatching because everything is shit #573

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented Oct 3, 2024

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


Important

Refactor validation logic using monkeypatching and add new models and custom types in openapi_model.py.

  • Validation Refactor:
    • Switch from subclassing to monkeypatching for validation functions in EvaluateStep, ToolCallStep, PromptStep, SetStep, LogStep, ReturnStep, YieldStep, IfElseWorkflowStep, and MapReduceStep.
    • Add validators for Python expressions and Jinja templates.
  • Model Changes:
    • Add CreateTransitionRequest and CreateEntryRequest classes.
    • Define custom types ChatMLContent, ChatMLRole, ChatMLSource, ExecutionStatus, and TransitionType.
  • Misc:
    • Allow extra fields in CreateTaskRequest, PatchTaskRequest, and UpdateTaskRequest using ConfigDict.

This description was created by Ellipsis for 8c03d93. 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 8c03d93 in 7 seconds

More details
  • Looked at 415 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/autogen/openapi_model.py:205
  • Draft comment:
    Replacing class inheritance with monkey patching for validators can lead to maintenance challenges and unexpected behavior. Consider documenting this change clearly to avoid confusion for future developers. This comment applies to all similar changes in this PR.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR replaces class inheritance with monkey patching for validators. This change is not ideal as it can lead to maintenance challenges and unexpected behavior. However, given the PR title and description, it seems the author is aware of the issues and has chosen this approach due to constraints. It's important to highlight this concern.

Workflow ID: wflow_HSe7bDXlWejbgkYE


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

@creatorrr creatorrr merged commit 2d62857 into dev Oct 3, 2024
6 of 7 checks passed
@creatorrr creatorrr deleted the x/autogen-patch branch October 3, 2024 01:58
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.

1 participant