langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
48.67k stars 6.97k forks source link

In "update document segment" interface at Knowledge API Page #9600

Closed nameIsNoPublic closed 2 hours ago

nameIsNoPublic commented 2 hours ago

Self Checks

Provide a description of requested docs changes

response should be a object but document write data is a "list" struct

dosubot[bot] commented 2 hours ago

Hey @nameIsNoPublic! I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let me know how I can assist you!

I found relevant information regarding the 'update document segment' interface. The expected structure of the response object is indeed an object, not a list. Here is the expected structure:

{
  "data": [{
    "id": "",
    "position": 1,
    "document_id": "",
    "content": "1",
    "answer": "1",
    "word_count": 25,
    "tokens": 0,
    "keywords": [
        "a"
    ],
    "index_node_id": "",
    "index_node_hash": "",
    "hit_count": 0,
    "enabled": true,
    "disabled_at": null,
    "disabled_by": null,
    "status": "completed",
    "created_by": "",
    "created_at": 1695312007,
    "indexing_at": 1695312007,
    "completed_at": 1695312007,
    "error": null,
    "stopped_at": null
  }]
}

This structure indicates that the response is an object containing a "data" key, which holds a list of segment objects [1]. If the documentation you are referring to describes the response as a list, it might be an error or miscommunication in the documentation.

To continue talking to Dosu, mention @dosu.

crazywoola commented 2 hours ago

Duplicated https://github.com/langgenius/dify/issues/9162

nameIsNoPublic commented 2 hours ago

Are you sure you have thoroughly checked it?