Agent Component to generateObject
Hi guys, I've tried the agent component, it's working on generate text, but not working when I tried to generateObject
and when I want to pass a schema, it's throwing error because schema type is undefined,
and when I try to generate the object and not using schema, I got this error :
[Request ID: a8fb2413930d45cd] Server Error
Uncaught ConvexError: Uncaught ConvexError: No agents added

6 Replies
Ah the types are off here. To generate an object today you have to set
output: "object"
, but AI SDK has that as the default so you don't have to set it
I'm not sure where "No agents added" is coming from - there isn't any error message like that in the component - is that in your code somewhere?Hi @ian , thanks for mention this, Silly me that is my error handle, I've use the generateObject and it's working, but I still do not find a way to fix the schema type error, so I give ts-ignore for now

does doing this fix it?
I also cut a fix so the
output
field isn't required for "object". It's in version @convex-dev/agent@0.0.9-alpha.1
if you want to give it a tryYes, it's working! Thanks. I didn't know that field was available because it wasn't suggested in typescript
Would you mind confirming if it works for you in the alpha version without providing that field? I think it makes sense to not require it for the default object case
Yep, thanks again, it's working without the output field after using the 0.0.9 alpha ver
