-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Note Splitter fails with OpenRouter provider #38
Comments
@Cyb3rN8 Awesome bug report here. TBD on exactly on when I will get to this but thank you for reporting! |
@Cyb3rN8 What model where you using for this? Does it support function calling and/or structured outputs? Please provide the link to it |
Provider-Specific Behavior Analysis
Technical Analysis
Interim Solution ProposalUntil Vercel implements official OpenRouter fixes:
|
@Cyb3rN8 Can you update to 0.2.70 and try again? I tried switching the mode for OpenRouter to be JSON specifically. |
Issue: Note Splitter fails with OpenRouter provider
Description:
The "Note Splitter" feature, which utilizes the
ai_sdk_structured
function, is currently failing when using the OpenRouter provider. This issue prevents users from effectively splitting notes into logical sections when OpenRouter is selected as the LLM provider.Steps to Reproduce:
Expected Behavior:
The note should be split into logical sections, with each section creating a new node on the canvas.
Actual Behavior:
The note splitter fails to generate new nodes.
Technical Details:
The issue seems to stem from the
ai_sdk_structured
function's interaction with the OpenRouter provider. While setting themode
to"json"
inai_sdk_structured
resolves the initial "Not Found" error from OpenRouter (likely due to the provider successfully returning a JSON response), a subsequent parsing error occurs. This suggests a problem with how the Vercel AI SDK handles the JSON response from OpenRouter.Relevant Code:
llm_calls.ts
:ai_sdk_structured
functionmain.ts
: Note Splitter implementation within theaddExtraActions
method (specifically, thegraphButtonEl.addEventListener("click", () => { ... })
block).Possible Cause:
Incompatibility between the Vercel AI SDK's JSON parsing and the format of the JSON response returned by OpenRouter.
Suggested Solution:
generateObject
function.ai_sdk_structured
function to handle the OpenRouter response format correctly.Additional context
The issue occurs because the
generateObject
function from the Vercel AI SDK, which is used inai_sdk_structured
, has trouble parsing the JSON response from OpenRouter, even when themode
is set to"json"
.The text was updated successfully, but these errors were encountered: