⨯ node_modules/.pnpm/openai@4.38.1_encoding@0.1.13/node_modules/openai/error.mjs (41:0) @ APIError.generate
⨯ 400 Invalid type for 'attachments[0].tools[0]': expected an object, but got a string instead.
TS2322: Type '{ file_id: any; tools: { type: string; }[]; }[] | undefined' is not assignable to type 'Attachment[] | null | undefined'. Type '{ file_id: any; tools: { type: string; }[]; }[]' is not assignable to type 'Attachment[]'. Type '{ file_id: any; tools: { type: string; }[]; }' is not assignable to type 'Attachment'. Types of property 'tools' are incompatible. Type '{ type: string; }[]' is not assignable to type '("file_search" | "code_interpreter")[]'. Type '{ type: string; }' is not assignable to type '"file_search" | "code_interpreter"'.
quick update: we downgraded to openai@4.38.0 and used the tools: [{type: 'file_search'}] approach and that works without problems.
so the issue was introduced in opeanai@4.38.1… looks like the type was updated (i think that type is better!), but the mapping to the request has a problem.