Skip to content

Conversation

@snowyu
Copy link
Contributor

@snowyu snowyu commented Dec 23, 2023

Refactor Backend with Abstract CustomBackend using AoP (Aspect Oriented Programming) and PropertyManager [WIP] - Not Yet Ready for Merge!

Description:

This pull request is part of our ongoing effort to refactor the backend services by introducing an abstract CustomBackend, leveraging a hierarchical factory pattern, specifically implemented using Aspect Oriented Programming (AoP) through 'custom-factory' package. I also incorporate JSONSchema definitions for UI elements management in React applications via rjsf (React JSon Schema Form). Additionally, I use the 'property-manager` library to manage and organize our back-end properties related to these services within a structured and consistent manner.

Motivation:

The refactoring is crucial due to growing complexity and difficulty managing various implementations across similar services like chatbots, text-to-speech systems, etc., within our application's backend architecture. By decoupling interface logic from concrete implementation details through the use of abstract interfaces, employing AoP techniques with 'custom-factory', and using property-manager to manage JSON Schema properties in a structured way

Implementation Status:

At present, this PR has completed initial setup work for integrating Aspect Oriented Programming (AoP) through the use of the custom factory pattern provided by 'custom-factory' package. This includes setting up abstract interfaces and factories that manage different products associated with each back-end service based on their configurations

  • Abstract Backend: CustomBackend
  • Hierarchical back-end factory pattern
    • bot: chatbot (Factory Item)
      • llamacpp (Product Item)
      • chatgpt (Product Item)
    • tts (Factory Item)
    • stt (Factory Item)
    • storage (Factory Item)
  • Separate UI from backend, use JSONSchema.

WIP & Documentation:

Please note that this PR is a work in progress, meaning many sections are not yet fully working or documented. I encourage you to review the code changes carefully. If any questions arise, feel free to ask for clarification; I will do my best to provide a detailed explanation and address concerns promptly.

@vercel
Copy link

vercel bot commented Dec 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
amica ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2024 11:32pm

@kasumi-1
Copy link
Contributor

Wow, this looks like a great start. Busy with christmas stuff so haven't had time to digest this yet, will review soon.

@snowyu
Copy link
Contributor Author

snowyu commented Sep 23, 2024

@kasumi-1 I originally intended to abstract a framework for freely registering and using AI tools: https://github.com/isdk/ai-tool.js

However, the project evolved significantly and ultimately transformed into Programmable Prompt Engine Language: https://github.com/offline-ai/cli

Now I find myself stuck in the complexity of my own project.

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