CleoPatraC
Convex Community10mo ago
15 replies
CleoPatra

Trying to use the new Ai Agent Error

Hey im trying to use the ai agent that was just posted but im probably missing something because straight away im getting this error:

code:
const supportAgent = new Agent(components.agent, {
thread: openai.chat("gpt-4o-mini"),
textEmbedding: openai.embedding("text-embedding-3-small"),
instructions: "You are a helpful assistant.",
});

error on components.agent:

Argument of type '{ messages: { addMessages: FunctionReference<"mutation", "internal", { agentName?: string | undefined; embeddings?: { dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096; model: string; vectors: (number[] | null)[]; } | undefined; ... 7 more ...; userId?: string | undefined; }, { ...; }>; ... 15 more...' is not assignable to parameter of type '{ [x: string]: { [x: string]: FunctionReference<any, "internal", any, any, string | undefined>; }; }'.
Property 'vector' is incompatible with index signature.
Type '{ index: { deleteBatch: FunctionReference<"mutation", "internal", { ids: string[]; }, null>; deleteBatchForThread: FunctionReference<"mutation", "internal", { cursor?: string | undefined; limit: number; model: string; threadId: string; vectorDimension: 128 | ... 7 more ... | 4096; }, { ...; }>; insertBatch: Function...' is not assignable to type '{ [x: string]: FunctionReference<any, "internal", any, any, string | undefined>; }'.
Property 'index' is incompatible with index signature.
Type '{ deleteBatch: FunctionReference<"mutation", "internal", { ids: string[]; }, null>; deleteBatchForThread: FunctionReference<"mutation", "internal", { cursor?: string | undefined; limit: number; model: string; threadId: string; vectorDimension: 128 | ... 7 more ... | 4096; }, { ...; }>; insertBatch: FunctionReference...' is missing the following properties from type 'FunctionReference<any, "internal", any, any, string | undefined>': _type, _visibility, _args, _returnType, _componentPath
Was this page helpful?