Cannot POST using knowledge API #1118

Closed
opened 2026-02-21 17:30:04 -05:00 by yindo · 7 comments
Owner

Originally created by @mcathena on GitHub (Feb 27, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Provide a description of the help you need

I'm trying to use /datasets/{dataset_id}/document/create_by_file API.
My method is

  1. query knowledge list from API and get my dataset_id
  2. copied and replace dataset_id and api_key with my own (I hided my key and id in scripts below but when I code these variables were correct)
curl --location POST 'https://api.dify.ai/v1/datasets/{dataset_id}/document/create_by_file' \
--header 'Authorization: Bearer {api_key}' \
--form 'data="{"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \
--form 'file=@"/path/to/file"'
  1. returned error
Warning: Trailing data after quoted form parameter
curl: (26) Failed to open/read local data from file/application
  1. the curl command above returned error so I tried to modify it into a python script
import requests

url = "http://127.0.0.1:5001/v1/datasets/{my_dataset_id_hide}/document/create_by_file"

headers = {
    "Authorization": "Bearer dataset-my-api-key-hide"
}

data = {
    "indexing_technique": "high_quality",
    "process_rule": {
        "rules": {
            "pre_processing_rules": [
                {"id": "remove_extra_spaces", "enabled": True},
                {"id": "remove_urls_emails", "enabled": True}
            ],
            "segmentation": {
                "separator": "###",
                "max_tokens": 500
            }
        },
        "mode": "custom"
    }
}

files = {
    'data': ('', str(data), 'text/plain'),
    'file': ('assistant.txt', open('/Users/linspirit/Downloads/assistant.txt', 'rb'))
}

response = requests.post(url, headers=headers, files=files)

print(response.text)
  1. at first it showed internal server error because my knowledge base was empty
  2. after adding some files to knowledge base, I tried create_by_file api
  3. return
"POST /v1/datasets/{my_dataset_id_hide_here}/document/create_by_file HTTP/1.1" 400 -
{
    "code": "too_many_files",
    "message": "Only one file is allowed.",
    "status": 400
}

Am I doing anything wrong here?

Originally created by @mcathena on GitHub (Feb 27, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### Provide a description of the help you need I'm trying to use /datasets/{dataset_id}/document/create_by_file API. My method is 1. query knowledge list from API and get my dataset_id 2. copied and replace dataset_id and api_key with my own (I hided my key and id in scripts below but when I code these variables were correct) ``` curl --location POST 'https://api.dify.ai/v1/datasets/{dataset_id}/document/create_by_file' \ --header 'Authorization: Bearer {api_key}' \ --form 'data="{"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \ --form 'file=@"/path/to/file"' ``` 3. returned error ``` Warning: Trailing data after quoted form parameter curl: (26) Failed to open/read local data from file/application ``` 5. the curl command above returned error so I tried to modify it into a python script ``` import requests url = "http://127.0.0.1:5001/v1/datasets/{my_dataset_id_hide}/document/create_by_file" headers = { "Authorization": "Bearer dataset-my-api-key-hide" } data = { "indexing_technique": "high_quality", "process_rule": { "rules": { "pre_processing_rules": [ {"id": "remove_extra_spaces", "enabled": True}, {"id": "remove_urls_emails", "enabled": True} ], "segmentation": { "separator": "###", "max_tokens": 500 } }, "mode": "custom" } } files = { 'data': ('', str(data), 'text/plain'), 'file': ('assistant.txt', open('/Users/linspirit/Downloads/assistant.txt', 'rb')) } response = requests.post(url, headers=headers, files=files) print(response.text) ``` 6. at first it showed internal server error because my knowledge base was empty 7. after adding some files to knowledge base, I tried create_by_file api 8. return ``` "POST /v1/datasets/{my_dataset_id_hide_here}/document/create_by_file HTTP/1.1" 400 - { "code": "too_many_files", "message": "Only one file is allowed.", "status": 400 } ``` Am I doing anything wrong here?
yindo closed this issue 2026-02-21 17:30:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 27, 2024):

🤖

Hello @mcathena! 🌟 I'm Dosu, a friendly bot here to sprinkle some assistance while you wait for a human maintainer. Whether you're squashing bugs, have questions, or looking to contribute, I'm your go-to bot for help in the meantime. Let's dive into your issue and see what's going on, shall we? 🛠️

@dosubot[bot] commented on GitHub (Feb 27, 2024): _🤖_ <!-- Greeting --> Hello @mcathena! 🌟 I'm Dosu, a friendly bot here to sprinkle some assistance while you wait for a human maintainer. Whether you're squashing bugs, have questions, or looking to contribute, I'm your go-to bot for help in the meantime. Let's dive into your issue and see what's going on, shall we? 🛠️
Author
Owner

@mcathena commented on GitHub (Feb 27, 2024):

🤖

Hello @mcathena! 🌟 I'm Dosu, a friendly bot here to sprinkle some assistance while you wait for a human maintainer. Whether you're squashing bugs, have questions, or looking to contribute, I'm your go-to bot for help in the meantime. Let's dive into your issue and see what's going on, shall we? 🛠️

sure

@mcathena commented on GitHub (Feb 27, 2024): > _🤖_ > > Hello @mcathena! 🌟 I'm Dosu, a friendly bot here to sprinkle some assistance while you wait for a human maintainer. Whether you're squashing bugs, have questions, or looking to contribute, I'm your go-to bot for help in the meantime. Let's dive into your issue and see what's going on, shall we? 🛠️ sure
Author
Owner

@dosubot[bot] commented on GitHub (Feb 27, 2024):

🤖

Based on the information you've provided and the context from the repository, it seems like there are a couple of issues with your current approach.

Firstly, the error "Only one file is allowed" is due to the TooManyFilesError exception being raised. This exception is raised when more than one file is attempted to be uploaded in a single request to the API endpoint that expects only a single file. In your Python script, you're trying to upload the 'data' and 'file' in the same request which is causing the issue. You should ensure that your Python script is configured to upload only one file per request to the specified API endpoint. You can find more details about this in the error.py file.

Secondly, the 'data' field in your Python script seems to be incorrectly formatted. The correct format for the 'data' field when making a request to the /datasets/{dataset_id}/document/create_by_file API endpoint is a JSON object that includes at least the following keys: doc_form, doc_language, and indexing_technique. You can find more details about this in the document.py file.

Lastly, based on a similar solved issue in the repository, it seems like the 'data' field should be sent as a string in the form data. You can refer to the issue #2164 for more details.

Here's how you can modify your Python script:

import requests
import json

url = "http://127.0.0.1:5001/v1/datasets/{my_dataset_id_hide}/document/create_by_file"

headers = {
    "Authorization": "Bearer dataset-my-api-key-hide"
}

data = {
    "doc_form": "text_model",
    "doc_language": "English",
    "indexing_technique": "high_quality",
    "process_rule": {
        "rules": {
            "pre_processing_rules": [
                {"id": "remove_extra_spaces", "enabled": True},
                {"id": "remove_urls_emails", "enabled": True}
            ],
            "segmentation": {
                "separator": "###",
                "max_tokens": 500
            }
        },
        "mode": "custom"
    }
}

files = {
    'data': ('', json.dumps(data), 'text/plain'),
    'file': ('assistant.txt', open('/Users/linspirit/Downloads/assistant.txt', 'rb'))
}

response = requests.post(url, headers=headers, files=files)

print(response.text)

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Feb 27, 2024): _🤖_ <!-- Answer --> Based on the information you've provided and the context from the repository, it seems like there are a couple of issues with your current approach. Firstly, the error "Only one file is allowed" is due to the `TooManyFilesError` exception being raised. This exception is raised when more than one file is attempted to be uploaded in a single request to the API endpoint that expects only a single file. In your Python script, you're trying to upload the 'data' and 'file' in the same request which is causing the issue. You should ensure that your Python script is configured to upload only one file per request to the specified API endpoint. You can find more details about this in the [error.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/error.py) file. Secondly, the 'data' field in your Python script seems to be incorrectly formatted. The correct format for the 'data' field when making a request to the `/datasets/{dataset_id}/document/create_by_file` API endpoint is a JSON object that includes at least the following keys: `doc_form`, `doc_language`, and `indexing_technique`. You can find more details about this in the [document.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py) file. Lastly, based on a similar solved issue in the repository, it seems like the 'data' field should be sent as a string in the form data. You can refer to the [issue #2164](https://github.com/langgenius/dify/issues/2164) for more details. Here's how you can modify your Python script: ```python import requests import json url = "http://127.0.0.1:5001/v1/datasets/{my_dataset_id_hide}/document/create_by_file" headers = { "Authorization": "Bearer dataset-my-api-key-hide" } data = { "doc_form": "text_model", "doc_language": "English", "indexing_technique": "high_quality", "process_rule": { "rules": { "pre_processing_rules": [ {"id": "remove_extra_spaces", "enabled": True}, {"id": "remove_urls_emails", "enabled": True} ], "segmentation": { "separator": "###", "max_tokens": 500 } }, "mode": "custom" } } files = { 'data': ('', json.dumps(data), 'text/plain'), 'file': ('assistant.txt', open('/Users/linspirit/Downloads/assistant.txt', 'rb')) } response = requests.post(url, headers=headers, files=files) print(response.text) ``` I hope this helps! If you have any other questions or need further clarification, feel free to ask. ## Sources - [bad_request_key_error:The browser (or proxy) sent a request that this server could not understand.](https://github.com/langgenius/dify/issues/2164) - [api/controllers/service_api/dataset/error.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/error.py) - [api/controllers/service_api/dataset/document.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py) <!-- Dosu Comment Footer --> <details open> <summary> #### About Dosu </summary> This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. </details>
Author
Owner

@mcathena commented on GitHub (Feb 27, 2024):

🤖

Based on the information you've provided and the context from the repository, it seems like there are a couple of issues with your current approach.

Firstly, the error "Only one file is allowed" is due to the TooManyFilesError exception being raised. This exception is raised when more than one file is attempted to be uploaded in a single request to the API endpoint that expects only a single file. In your Python script, you're trying to upload the 'data' and 'file' in the same request which is causing the issue. You should ensure that your Python script is configured to upload only one file per request to the specified API endpoint. You can find more details about this in the error.py file.

Secondly, the 'data' field in your Python script seems to be incorrectly formatted. The correct format for the 'data' field when making a request to the /datasets/{dataset_id}/document/create_by_file API endpoint is a JSON object that includes at least the following keys: doc_form, doc_language, and indexing_technique. You can find more details about this in the document.py file.

Lastly, based on a similar solved issue in the repository, it seems like the 'data' field should be sent as a string in the form data. You can refer to the issue #2164 for more details.

Here's how you can modify your Python script:

import requests
import json

url = "http://127.0.0.1:5001/v1/datasets/{my_dataset_id_hide}/document/create_by_file"

headers = {
    "Authorization": "Bearer dataset-my-api-key-hide"
}

data = {
    "doc_form": "text_model",
    "doc_language": "English",
    "indexing_technique": "high_quality",
    "process_rule": {
        "rules": {
            "pre_processing_rules": [
                {"id": "remove_extra_spaces", "enabled": True},
                {"id": "remove_urls_emails", "enabled": True}
            ],
            "segmentation": {
                "separator": "###",
                "max_tokens": 500
            }
        },
        "mode": "custom"
    }
}

files = {
    'data': ('', json.dumps(data), 'text/plain'),
    'file': ('assistant.txt', open('/Users/linspirit/Downloads/assistant.txt', 'rb'))
}

response = requests.post(url, headers=headers, files=files)

print(response.text)

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

I referred to issue 2164. However, I still wasn't able to get it to work.
my curl is

curl --location POST 'http://127.0.0.1:5001/v1/datasets/{my_dataset_id}/document/create_by_file' \
--header 'Authorization: Bearer dataset-my-api-key' \
--form 'data="{"name":"assistant","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \
--form 'file=@"/Users/linspirit/Downloads/assistant.txt"'

returned error

{
    "code": "invalid_param",
    "message": "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)",
    "status": 400
}
@mcathena commented on GitHub (Feb 27, 2024): > _🤖_ > > Based on the information you've provided and the context from the repository, it seems like there are a couple of issues with your current approach. > > Firstly, the error "Only one file is allowed" is due to the `TooManyFilesError` exception being raised. This exception is raised when more than one file is attempted to be uploaded in a single request to the API endpoint that expects only a single file. In your Python script, you're trying to upload the 'data' and 'file' in the same request which is causing the issue. You should ensure that your Python script is configured to upload only one file per request to the specified API endpoint. You can find more details about this in the [error.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/error.py) file. > > Secondly, the 'data' field in your Python script seems to be incorrectly formatted. The correct format for the 'data' field when making a request to the `/datasets/{dataset_id}/document/create_by_file` API endpoint is a JSON object that includes at least the following keys: `doc_form`, `doc_language`, and `indexing_technique`. You can find more details about this in the [document.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py) file. > > Lastly, based on a similar solved issue in the repository, it seems like the 'data' field should be sent as a string in the form data. You can refer to the [issue #2164](https://github.com/langgenius/dify/issues/2164) for more details. > > Here's how you can modify your Python script: > > ```python > import requests > import json > > url = "http://127.0.0.1:5001/v1/datasets/{my_dataset_id_hide}/document/create_by_file" > > headers = { > "Authorization": "Bearer dataset-my-api-key-hide" > } > > data = { > "doc_form": "text_model", > "doc_language": "English", > "indexing_technique": "high_quality", > "process_rule": { > "rules": { > "pre_processing_rules": [ > {"id": "remove_extra_spaces", "enabled": True}, > {"id": "remove_urls_emails", "enabled": True} > ], > "segmentation": { > "separator": "###", > "max_tokens": 500 > } > }, > "mode": "custom" > } > } > > files = { > 'data': ('', json.dumps(data), 'text/plain'), > 'file': ('assistant.txt', open('/Users/linspirit/Downloads/assistant.txt', 'rb')) > } > > response = requests.post(url, headers=headers, files=files) > > print(response.text) > ``` > > I hope this helps! If you have any other questions or need further clarification, feel free to ask. > > ## Sources > * [bad_request_key_error:The browser (or proxy) sent a request that this server could not understand.](https://github.com/langgenius/dify/issues/2164) > * [api/controllers/service_api/dataset/error.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/error.py) > * [api/controllers/service_api/dataset/document.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py) > > #### About Dosu > This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. > > Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. > > If you want to continue the conversation, start your reply with @dosu-bot. I referred to [issue 2164](https://github.com/langgenius/dify/issues/2164). However, I still wasn't able to get it to work. my curl is ``` curl --location POST 'http://127.0.0.1:5001/v1/datasets/{my_dataset_id}/document/create_by_file' \ --header 'Authorization: Bearer dataset-my-api-key' \ --form 'data="{"name":"assistant","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \ --form 'file=@"/Users/linspirit/Downloads/assistant.txt"' ``` returned error ``` { "code": "invalid_param", "message": "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)", "status": 400 } ```
Author
Owner

@dosubot[bot] commented on GitHub (Feb 27, 2024):

🤖

The error message you're seeing is related to the JSON formatting in your curl command. JSON data should be enclosed in single quotes ('{}') when used in a shell command to prevent the shell from interpreting special characters, and all JSON property names and string values should be enclosed in double quotes.

However, the actual issue causing the "invalid_param" error is the incorrect formatting and encapsulation of the JSON payload in the --form parameter. When using curl with --form (or -F), the data should not be enclosed in double quotes inside the single quotes. Additionally, the type=text/plain part seems to be incorrectly appended and might be causing confusion in how the data is being parsed.

The correct format for the JSON payload in the --form parameter when using the /datasets/{dataset_id}/document/create_by_file API is as follows:

{
  "data": "<JSON_STRING>"
}

Where <JSON_STRING> should be a stringified JSON object containing the necessary information for document creation. This is because the code snippet from DocumentAddByFileApi class shows that the JSON payload is expected to be part of the form data under the key data. The JSON object is then parsed using json.loads(request.form['data']).

The parsed JSON object can include fields such as doc_form, doc_language, and any other relevant information as per the API's requirements. However, the exact structure of the JSON object inside data depends on the specific fields and values the API endpoint expects, which are not fully detailed in the provided context.

Unfortunately, without specific details on how the API expects the form data to be formatted for file uploads alongside JSON data, I cannot provide a corrected version of the command. You may need to consult the API documentation or support for the correct format.

For more information, you can refer to the following sources:

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Feb 27, 2024): _🤖_ <!-- Answer --> The error message you're seeing is related to the JSON formatting in your curl command. JSON data should be enclosed in single quotes ('{}') when used in a shell command to prevent the shell from interpreting special characters, and all JSON property names and string values should be enclosed in double quotes. However, the actual issue causing the "invalid_param" error is the incorrect formatting and encapsulation of the JSON payload in the `--form` parameter. When using `curl` with `--form` (or `-F`), the data should not be enclosed in double quotes inside the single quotes. Additionally, the `type=text/plain` part seems to be incorrectly appended and might be causing confusion in how the data is being parsed. The correct format for the JSON payload in the `--form` parameter when using the `/datasets/{dataset_id}/document/create_by_file` API is as follows: ```json { "data": "<JSON_STRING>" } ``` Where `<JSON_STRING>` should be a stringified JSON object containing the necessary information for document creation. This is because the code snippet from `DocumentAddByFileApi` class shows that the JSON payload is expected to be part of the form data under the key `data`. The JSON object is then parsed using `json.loads(request.form['data'])`. The parsed JSON object can include fields such as `doc_form`, `doc_language`, and any other relevant information as per the API's requirements. However, the exact structure of the JSON object inside `data` depends on the specific fields and values the API endpoint expects, which are not fully detailed in the provided context. Unfortunately, without specific details on how the API expects the form data to be formatted for file uploads alongside JSON data, I cannot provide a corrected version of the command. You may need to consult the API documentation or support for the correct format. For more information, you can refer to the following sources: - [en/features/datasets/maintain-dataset-via-api.md](https://github.com/langgenius/dify-docs/blob/main/en/features/datasets/maintain-dataset-via-api.md) - [api/controllers/service_api/dataset/document.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py) ## Sources - [en/features/datasets/maintain-dataset-via-api.md](https://github.com/langgenius/dify-docs/blob/main/en/features/datasets/maintain-dataset-via-api.md) - [api/controllers/service_api/dataset/document.py](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py) <!-- Dosu Comment Footer --> <details> <summary> #### About Dosu </summary> This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. </details>
Author
Owner

@mcathena commented on GitHub (Feb 27, 2024):

issue solved. should be

curl --location POST 'http://127.0.0.1:5001/v1/datasets/{dataset_id}/document/create_by_file'
--header 'Authorization: Bearer {api-key}'
--form 'data={"name":"assistant","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}};type=text/plain'
--form 'file=@assistant.txt'

@mcathena commented on GitHub (Feb 27, 2024): issue solved. should be curl --location POST 'http://127.0.0.1:5001/v1/datasets/{dataset_id}/document/create_by_file' \ --header 'Authorization: Bearer {api-key}' \ --form 'data={"name":"assistant","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}};type=text/plain' \ --form 'file=@assistant.txt'
Author
Owner

@zzw1123 commented on GitHub (Oct 21, 2024):

issue solved. should be

curl --location POST 'http://127.0.0.1:5001/v1/datasets/{dataset_id}/document/create_by_file' --header 'Authorization: Bearer {api-key}' --form 'data={"name":"assistant","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}};type=text/plain' --form 'file=@assistant.txt'

Perfect answer!

@zzw1123 commented on GitHub (Oct 21, 2024): > issue solved. should be > > curl --location POST '[http://127.0.0.1:5001/v1/datasets/{dataset_id}/document/create_by_file](http://127.0.0.1:5001/v1/datasets/%7Bdataset_id%7D/document/create_by_file)' --header 'Authorization: Bearer {api-key}' --form 'data={"name":"assistant","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}};type=text/plain' --form 'file=@assistant.txt' Perfect answer!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1118