You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fileData in financial-data-analyst\app\api\finance\route.ts appears like it will never be used as the frontend will never populate that field. This looks like a vestige of a refactor as the frontend ends up constructing the meat of what gets sent to the Anthropic API.
I see two ways to resolve this:
Remove all usage of fileData in route.ts. This is the most straightforward but a benefit of having that functionality on the backend is you don't allow a malicious frontend to insert extra stuff into what gets sent to the Anthropic API.
Move all the work done by apiMessages in app\finance\page.tsx to be done on the backend. More work but maybe a better practice to follow?
This is an example app, so maybe the security aspect isn't worth worrying about here. At the very least I found it confusing to have this functionality in both places because I initially modified what was in route.ts and it took me a while to figure out why the change wasn't having any effect (I actually needed to make the change in page.tsx).
The text was updated successfully, but these errors were encountered:
fileData
infinancial-data-analyst\app\api\finance\route.ts
appears like it will never be used as the frontend will never populate that field. This looks like a vestige of a refactor as the frontend ends up constructing the meat of what gets sent to the Anthropic API.I see two ways to resolve this:
fileData
inroute.ts
. This is the most straightforward but a benefit of having that functionality on the backend is you don't allow a malicious frontend to insert extra stuff into what gets sent to the Anthropic API.apiMessages
inapp\finance\page.tsx
to be done on the backend. More work but maybe a better practice to follow?This is an example app, so maybe the security aspect isn't worth worrying about here. At the very least I found it confusing to have this functionality in both places because I initially modified what was in
route.ts
and it took me a while to figure out why the change wasn't having any effect (I actually needed to make the change inpage.tsx
).The text was updated successfully, but these errors were encountered: