weavel-ai / Ape

Your first AI prompt engineer
https://docs.weavel.ai/sdk-reference/ape-common
MIT License
331 stars 13 forks source link

feat: setup monorepo, separate packages (common/core) #24

Closed aschung01 closed 1 week ago

aschung01 commented 1 week ago

Description

This pull request sets up a monorepo structure and separates packages into common and core components. The main changes include:

  1. Restructuring the project layout:

    • Moving common functionality to libs/ape-common/ape/common/
    • Removing the main ape/ directory
    • Updating import statements to reflect the new structure
  2. Refactoring and enhancing existing components:

    • Updating the BaseMetric, BaseGlobalMetric, and EvaluationConfig classes
    • Introducing new classes like BaseGenerate and Generate
    • Modifying the Evaluate class to work with the new structure
  3. Improving the build and publish workflow:

    • Updating .github/workflows/publish.yml to support package-specific releases
  4. Enhancing metric implementations:

    • Refactoring JsonMatchMetric, CosineSimilarityMetric, and SemanticF1Metric
    • Introducing a new ApeMetricPrompts class for managing metric-related prompts

These changes aim to improve the project's modularity, maintainability, and extensibility by separating concerns and providing a more organized structure for future development.

Changes that Break Backward Compatibility

  1. Import statements: Due to the restructuring, all import statements referencing the ape package will need to be updated to use the new ape.common package structure.

  2. Class and function signatures: Some classes and functions have been modified, which may require updates in code that uses them. For example:

    • BaseMetric.compute() method signature has changed
    • Evaluate class initialization and usage may need to be updated
  3. Removal of ape/__init__.py: The main ape package no longer exists, which will break any code that imports directly from ape.

  4. Configuration changes: The EvaluationConfig class has been modified, which may require updates to any code that uses it.

Documentation

N/A

Created with Palmier

aschung01 commented 1 week ago

@palmier-bot describe