Source code for veupath_chatbot.ai.tools.research_registry

"""Shared research tool mixin (web + literature search).

Used by both `PlannerToolRegistryMixin` and `AgentToolRegistryMixin` so that
web and literature search are available regardless of conversation mode.
"""

from typing import Annotated, cast

from kani import AIParam, ai_function

from veupath_chatbot.domain.research import LiteratureSort
from veupath_chatbot.platform.types import JSONObject
from veupath_chatbot.services.research import (
    LiteratureSearchService,
    WebSearchService,
)


[docs] class ResearchToolsMixin: """Mixin that exposes web and literature search as Kani tools. Classes using this mixin must provide these attributes: - web_search_service: WebSearchService - literature_search_service: LiteratureSearchService """ web_search_service: WebSearchService = cast("WebSearchService", cast(object, None)) literature_search_service: LiteratureSearchService = cast( "LiteratureSearchService", cast(object, None) )