OpenAI retrieving an assistant - Error using async function - Cannot convert undefined or null to object

Hi everyone,

I’m quite desperate trying to retrieve my assistant object when loading my “chat component”.

Here is my service code:

And my component chat.ts

And I get this error:
Cannot convert undefined or null to object
at Function.getPrototypeOf ()
at eval (d:/Users/nacho/OneDrive/Empathia/Angular/EmpathiaFront/node_modules/web-streams-polyfill/dist/ponyfil…

I guess there is some issue with the definition of the async method … but can’t guess how to solve it.

Any help would be very much appreciated!


In the return of your getAssistant function, you enclosed it in { } rather than sending the return as is:

return Response.json({ myAssistant })

should probably be

return Response.json(myAssistant)

Thank you for your help@supershaneski, but same error after deleting the {}.