=== Calling Function ===
Calling function: endoscopia with args: ¡Hola! Para sacar (............) ponibles?
Error chatbot: Expecting value: line 1 column 1 (char 0)
¡
character is causing me problems. Do you have any ides how I can solve this problem??class CustomRetriever(BaseRetriever):
def __init__(self, retriever, tool) -> None:
"""Init params."""
self._base_retriever = retriever
self._always_tool = tool
def _retrieve(self, query_bundle: QueryBundle) -> List[NodeWithScore]:
"""Retrieve nodes given query."""
base_tools = self._base_retriever.retrieve(query_bundle)
if self._always_tool in base_tools:
base_tools.remove(self._always_tool)
return base_tools + [self._always_tool]
self._agent = FnRetrieverOpenAIAgent.from_retriever(
retriever=CustomRetriever(
obj_index.as_retriever(similarity_top_k=5),
query_engine_tool, # this is the tool you always want to fetch
),
llm=llm,
callback_manager=callback_manager,
memory=_memory,
system_prompt=TEXT_QA_SYSTEM_PROMPT.content,
verbose=True,
)
DEFAULT_VECTOR_STORE_QUERY_PROMPT_TMPL
in the retriever?query_bundle.query_str= query_bundle.query_str.encode('utf-8')
?query_bundle.query_str= query_bundle.query_str.replace("¡", "")