I'm having issue's with using functions in appwrite and setting up open AI.
- 1
- React Native
- Apple
- Functions
- Cloud
Hi,
(This is new to me so go easy one me on the insults if I sound stupid)
I have a react native app (all working) and I wanted to integrate some AI into it so it can scan my data and reply specific things depending on the prompts I give it. To achieve this I decided to use the functions section in appwrite.
I've created my function, set my functions project up for open AI api (like it says to do in the documents) and published it, I have it running and completing executions but it's just not completing them the way I hoped.
Right now I keep getting this error in my project: Error calling AI function: [SyntaxError: JSON Parse error: Unexpected character: u] ERROR Failed to get AI analysis: [SyntaxError: JSON Parse error: Unexpected character: u].
I tried it another way with editing my function like they use in an appwrite project with an ai chatbot and I get this error: ERROR Error calling AI function: [Error: Function execution failed] ERROR Failed to get AI analysis: [Error: Function execution failed]
And in the function logs it says: TypeError: Cannot read properties of undefined (reading 'OPENAI_API_KEY') at Module.default (file:///usr/local/server/src/function/src/main.js:13:37) at execute (/usr/local/server/src/server.js:157:48) at async action (/usr/local/server/src/server.js:174:13) at async /usr/local/server/src/server.js:10:9
Any help someone could provide would be massively appreciated, more than happy to share my code as well π
Recommended threads
- Enabling Overage Usage
Hello Appwrite Support Team, I am currently using Appwrite under the GitHub Student Developer Pack plan. Recently, my project hit the database read limit, and ...
- appwrite-docs MCP fails in Cursor β SSE ...
Hi team, I'm having trouble getting the hosted Appwrite docs MCP working in Cursor on Windows. Environment IDE: Cursor (latest) OS: Windows 11 Node: v24.15.0 ...
- Migration from Cloud to Self-Hosted not ...
Hello Appwrite Community, I've got the problem, that when I try to migrate my Appwrite Project from the cloud to my self-hosted Appwrite, that an API Key is mi...