Skip to content

[Bug]: Empty response when disabling streaming in the RagFlow API #4885

Closed
@Peterson047

Description

@Peterson047

Is there an existing issue for the same bug?

  • I have checked the existing issues.

RAGFlow workspace code commit ID

448fa1c

RAGFlow image version

v0.16.0

Other environment information

Windows 11 Pro
I7 11ºGen
12Gb ram

Actual behavior

Description:
I am developing an application that will communicate with RagFlow via Make (Integromat). To achieve this, I used the following cURL request:

curl --request POST \
     --url http://{address}/api/v1/agents/{agent_id}/completions \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data-binary '
     {
          "question": "Hello",
          "stream": true,
          "session_id": "cb2f385cb86211efa36e0242ac120005"
     }'

Context

  • For {agent_id}, I used the dialogId from the chat link.
  • For session_id, I used the conversationId from the link.

The request works correctly when the stream parameter is set to true. However, the Make platform does not support this type of request, preventing the use of APIs that return responses via streaming.

By default, the RagFlow API returns responses via streaming with the "stream": true parameter. When I change it to "stream": false, the response comes back empty:

{
    "code": 100,
    "data": null,
    "message": "KeyError('content')"
}

Notes

  • In Postman, the response time suggests that processing was completed, but the data field returns null.
  • Am I missing any configuration, or could this be a bug in the current version?

Reference screenshot:
Error image

Additional Information

  • Environment: I am using version v0.16.0 (full).
  • Other relevant configurations: The chat API is Gemini 1.5 Pro.

I appreciate your support! 🚀

Expected behavior

I expected the complete response in a single return instead of streaming.

Steps to reproduce

I used the chat completion `cURL` request and changed the `stream` parameter to `false`. I expected to receive the complete response in a single return instead of streaming.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions