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
- Password check in function
Hi, is there any way now for checking if the users password is correct in a function? I am creating a delete user function and before deleting I would like to c...
- Invalid document structure: Unknown attr...
Environment: Dart version: 3.5.1 dart_appwrite: 13.0.0 I’ve already created the database structure using a Dart function. I can create data records using cloud...
- open runtime version lacks behind
open runtime version in appwrite CLI is v4 while the hosted runtimes use v5, this mismatch does not permit to debug locally functions using recent runtimes (li...