eliza icon indicating copy to clipboard operation
eliza copied to clipboard

Error invalid schema

Open nidhinakranii opened this issue 11 months ago • 2 comments

I am trying to develop a plugin and got this error while asking for token creation

["◎ Starting CREATE_TOKEN handler..."]

Error in generateObject: InvalidArgumentError [AI_InvalidArgumentError]: Invalid argument for parameter schema: Schema is required for object output.

cause: undefined, parameter: 'schema', value: undefined, [Symbol(vercel.ai.error)]: true, [Symbol(vercel.ai.error.AI_InvalidArgumentError)]: true } ["⛔ AI_InvalidArgumentError: Invalid argument for parameter schema: Schema is required for object output."]

nidhinakranii avatar Jan 15 '25 22:01 nidhinakranii

Hello @nidhinakranii! Welcome to the elizaOS community. Thank you for opening your first issue; we appreciate your contribution. You are now an elizaOS contributor!

github-actions[bot] avatar Jan 15 '25 22:01 github-actions[bot]

@nidhinakranii

https://github.com/elizaOS/eliza/blob/de9811786bc63a5e6fd20868e1bfc219cde97543/packages/plugin-coinbase/src/types.ts#L100

JoeyKhd avatar Jan 15 '25 23:01 JoeyKhd

Hello @nidhinakranii , the error suggests that the CREATE_TOKEN handler is missing a required schema parameter when attempting to generate an object. It appears the schema is either not defined or being passed as undefined in the function. Ensuring the schema parameter is properly defined and included in the request should resolve the issue.

Vitalii028 avatar Jan 17 '25 03:01 Vitalii028

I added schema and install it at root directory as well as plugin folder separately to check if it works but getting this issue :

Type 'ZodObject<{ name: ZodString; symbol: ZodString; }, "strip", ZodTypeAny, { symbol?: string; name?: string; }, { symbol?: string; name?: string; }>' is not assignable to type 'ZodType<any, ZodTypeDef, any>'. The types of '_getOrReturnCtx(...).common.issues' are incompatible between these types. Type 'Zod.ZodIssue[]' is not assignable to type @./anthropic/node_modules/zod/lib/ZodError").ZodIssue[]'. Type 'Zod.ZodIssue' is not assignable to type @./anthropic/node_modules/zod/lib/ZodError").ZodIssue'. Type 'ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'ZodIssue'. Type 'Zod.ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type @./anthropic/node_modules/zod/lib/ZodError").ZodInvalidUnionIssue & { fatal?: boolean; message: string; }'. Type 'ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'ZodInvalidUnionIssue'. Types of property 'unionErrors' are incompatible. Type 'Zod.ZodError[]' is not assignable to type @./anthropic/node_modules/zod/lib/ZodError").ZodError[]'. Type 'Zod.ZodError' is not assignable to type @./anthropic/node_modules/zod/lib/ZodError").ZodError'. Types of property 'issues' are incompatible. Type 'Zod.ZodIssue[]' is not assignable to type @./anthropic/node_modules/zod/lib/ZodError").ZodIssue[]'. Type 'Zod.ZodIssue' is not assignable to type @.***/anthropic/node_modules/zod/lib/ZodError").ZodIssue'. Type 'ZodInvalidUnionIssue & { fatal?: boolean; message: string; }' is not assignable to type 'ZodIssue'.ts(2322) generation.ts(1756, 5): The expected type comes from property 'schema' which is declared here on type 'GenerationOptions'

On Thu, 16 Jan 2025 at 22:37, HUC-VICTORY @.***> wrote:

Hello @nidhinakranii https://github.com/nidhinakranii , the error suggests that the CREATE_TOKEN handler is missing a required schema parameter when attempting to generate an object. It appears the schema is either not defined or being passed as undefined in the function. Ensuring the schema parameter is properly defined and included in the request should resolve the issue.

— Reply to this email directly, view it on GitHub https://github.com/elizaOS/eliza/issues/2339#issuecomment-2597366108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATHEF526IGM3LXQTTROA3XT2LB3JBAVCNFSM6AAAAABVIHPKVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJXGM3DMMJQHA . You are receiving this because you were mentioned.Message ID: @.***>

nidhinakranii avatar Jan 17 '25 06:01 nidhinakranii

This issue has been automatically marked as stale due to 30 days of inactivity. If no further activity occurs within 7 days, it will be closed automatically. Please take action if this issue is still relevant.

github-actions[bot] avatar Feb 16 '25 18:02 github-actions[bot]