Replies: 1 comment
-
To modify or add answers to a CHUNK using the Dify API, you should use the POST method instead of PATCH, as the PATCH method is not supported for updating specific segments within a document. Here is how you can update a segment: curl --location --request POST 'https://api.dify.ai/v1/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{"segment": {"content": "1","answer": "1", "keywords": ["a"], "enabled": false}}' This request allows you to update the content, answer, keywords, and enabled status of a specific segment [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Self Checks
Dify version
"server_version": "0.11.0"
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I am using the Dify API and trying to update specific segments within a document using the PATCH method. However, I keep getting a "405 Method Not Allowed" error. Could you confirm if segment updates are supported, and if so, provide the correct API method and endpoint for this operation?
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
Beta Was this translation helpful? Give feedback.
All reactions