NobubbleN
Convex Community4mo ago
11 replies
Nobubble

Unsafe assignment of an `any` value when working with Agents Component

Hey all,

I might be doing something stupid here but whenever I USE (eg. return, map, reassign) the query data inside my createTool i get errors all over the place.

// 'patientCheckins' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
const patientCheckins = await ctx.runQuery(api.checkins.getPatientCheckins, {
      patientId: ctx.patientId,
    });


Whenever i just query and dont use the result (just logging or ignoring) there are no errors. The data is there, typed and all, and my entire app already works on that data.

PS: Ive also noticed that ctx.auth.getUserIdentity returns nothing in Tools. Is that intentional because I would want to run some auth checks from the user thats calling it instead of giving the agent full access.

Thnx in advance
Was this page helpful?