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

[PY] feat: augmentations #1243

Merged
merged 8 commits into from
Feb 8, 2024
Merged

[PY] feat: augmentations #1243

merged 8 commits into from
Feb 8, 2024

Conversation

lilyydu
Copy link
Collaborator

@lilyydu lilyydu commented Feb 6, 2024

Linked issues

closes: #1068

Details

Implemented the logic and tests for augmentations for Python, based on JS.

  • Renamed the DO command's entities to parameters (from Steve's previous breaking changes)
  • Type for Schema is Dict[str, Any] to follow previous conventions
  • Renamed _token in ActionAugmentationSection to _token_list, as this conflicted with the super class' token property
  • Decomposed InnerMonologue into separate Thought and Action data classes
  • Added __test__ = False to TestablePromptSectionBase as this is apart of setup for the tests and a warning appeared that the class was being ran as a test instead
  • Follow-up PR to be added, to add augmentation logic to PromptManager and PromptTemplate

More specific:

  • For both MonologueAugmentation and SequenceAugmentation, in create_plan_from_response and validate_response, I removed the union for undefined parameters/return types, since these are required.
  • I also removed it for the Augmentation class type.
  • For MonologueAugmentation, I used the dataclass_json library to decode from dict to the class type, as our validator was throwing lint errors.
  • For SequenceAugmentation, I used our internal static method from_dict from the Plan class.

Attestation Checklist

  • My code follows the style guidelines of this project

  • I have checked for/fixed spelling, linting, and other errors

  • I have commented my code for clarity

  • I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)

  • My changes generate no new warnings

  • I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:

    • Local testing
    • E2E testing in Teams
  • New and existing unit tests pass locally with my changes

@lilyydu lilyydu marked this pull request as ready for review February 8, 2024 00:12
@aacebo aacebo merged commit d4d3349 into PYTHON Feb 8, 2024
@aacebo aacebo deleted the lilyydu/augmentations branch February 8, 2024 16:37
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