
Hello guys,
I run an execution Execution execution = await functions.getExecution(
functionId: functionId, executionId: executionId);
which call the Completation Chat API from OpenAI.
Since it took more than 30 seconds and I got the error Operation timed out after 30000 milliseconds
So I defined an async function:
`Execution result = await functions.createExecution( functionId: '65fd719a000f460e4896', body: body, method: 'POST', headers: headers, xasync: true);
var executionId = result.$id;
Execution execution = await functions.getExecution(
functionId:functionId, executionId: executionId);
while (
execution.status == 'waiting' || execution.status == 'processing') {
await Future.delayed(Duration(seconds: 5));
execution = await functions.getExecution(
functionId: functionId, executionId: executionId);
}`
The function is completed but I get the following error FormatException: SyntaxError: Unexpected end of JSON input
print(result.responseBody); does not print anything but I can see in the Admin console the body printed which is a valid JSON.
Why do I have the problem?
Recommended threads
- Local function cant access itself for li...
I use appwrite cloud, but before uploading, i want to work locally. in my local machine (windows 11) i have a running appwrite. I created a new appwrite func...
- ID.unique() is not creating unique ID in...
The Error is at line 65. See image. A Transaction should be created but it fails. Errors: Document with the requested ID already exists. Try again with a diff...
- Can't execute function because of some i...
Hi, I'm self hosting Appwrite 1.7.3 and when i execute a specific function i get an Status Code 500. And the `openruntimes-executor` prints out this error: ```...
