Find answers from the community

Updated last year

Hi how are you

Hi, how are you??
=== Calling Function === Calling function: endoscopia with args: ¡Hola! Para sacar (............) ponibles? Error chatbot: Expecting value: line 1 column 1 (char 0)
I am getting this error, it seems that the ¡ character is causing me problems. Do you have any ides how I can solve this problem??
b
e
L
23 comments
I think you could try and tell it to use UTF-8 encoding for the functions?
How can I configure that??
It would be in your prompt
the system prompt?
If I can see your code I can help more
But you're using a pydantic function?
It's a little messy
I use FucntionTool
is the same?
yes, I am using pydantic function
Logan created for me the other day a customretriever
lmao he's the best isnt he
this retriever choose between the function calling and list always add a basetoo
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]
I really didn't find where to set the UFT-8
I use the FnRetrieverOpenAIAgent as well:

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, )
@Logan M what do you think, should he customize. the DEFAULT_VECTOR_STORE_QUERY_PROMPT_TMPL in the retriever?
Hmm, maybe you just need to do query_bundle.query_str= query_bundle.query_str.encode('utf-8') ?
or you can just remove those characters query_bundle.query_str= query_bundle.query_str.replace("¡", "")
replace worked fine. thanks @bmax @Logan M !!
Oh I thought the thing causing you issues were coming back from llm not what you were sending.
Add a reply
Sign up and join the conversation on Discord