Open aurelticot opened 3 weeks ago
Yes, I'm aware this isn't great.
I want to move to using zod to verify the LLM response along with user input, but haven't got to that yet.
For now I'll add some basic checks, but will leave this issue open until we do something more robust.
When calling
llm/personal
with a simple prompt, I got a500
becausedatabases
was undefined on the following line.https://github.com/verida/data-connector-server/blob/3156b74ea5a8951abf868184a0d85fd942c6f273/src/services/assistants/search.ts#L49
Here are the logs
promptSearchResult
comes fromhttps://github.com/verida/data-connector-server/blob/3156b74ea5a8951abf868184a0d85fd942c6f273/src/services/tools/promptSearch.ts#L58
The assertion of a
JSON.parse
is error-prone. In that case it was assumeddatabases
(and other property) is defined as per thePromptSearchLLMResponse
type but it was not.The assertion is not the root cause of why
databases
isnull
but that doesn't help in static code analysis.