11"""Manages the shared state and workflow for Willa chatbots."""
2- from typing import Any , Optional , Annotated , NotRequired
2+ from typing import Optional , Annotated , NotRequired
33from typing_extensions import TypedDict
44
55from langchain_core .language_models import BaseChatModel
@@ -22,7 +22,7 @@ class WillaChatbotState(TypedDict):
2222 messages_for_generation : NotRequired [list [AnyMessage ]]
2323 search_query : NotRequired [str ]
2424 tind_metadata : NotRequired [str ]
25- documents : NotRequired [list [Any ]]
25+ documents : NotRequired [list [dict [ str , str ] ]]
2626
2727
2828class GraphManager : # pylint: disable=too-few-public-methods
@@ -91,7 +91,7 @@ def _prepare_search_query(self, state: WillaChatbotState) -> dict[str, str]:
9191
9292 return {"search_query" : search_query }
9393
94- def _retrieve_context (self , state : WillaChatbotState ) -> dict [str , str | list [Any ]]:
94+ def _retrieve_context (self , state : WillaChatbotState ) -> dict [str , str | list [dict [ str , str ] ]]:
9595 """Retrieve relevant context from vector store."""
9696 search_query = state .get ("search_query" , "" )
9797 vector_store = self ._vector_store
0 commit comments