Skip to content

Refactor chatbot to use dependency injection for corpus building #21

@Alen983

Description

@Alen983

The chatbot's _build_corpus() function is tightly coupled and hard to test.
Refactoring improves testability and extensibility.

Relevant part of the codebase:

  • backend/app/routers/chatbot.py

Expected outcome:

  • Extract corpus building into a service class
  • Use dependency injection for database access
  • Make it easier to add new data sources (e.g., external APIs)
  • Add unit tests for corpus building logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions