Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: RAGFlow API related issues #4149

Open
1 task done
majian159 opened this issue Dec 20, 2024 · 0 comments
Open
1 task done

[Bug]: RAGFlow API related issues #4149

majian159 opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@majian159
Copy link

majian159 commented Dec 20, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

RAGFlow workspace code commit ID

a5cf6fc

RAGFlow image version

v0.15.0

Other environment information

No response

Actual behavior

Add chunk

POST /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks

current api doc response:

{
    "code": 0,
    "data": {
        "chunk": {
            "content": "ragflow content",
            "create_time": "2024-10-16 08:05:04",
            "create_timestamp": 1729065904.581025,
            "dataset_id": [
                "c7ee74067a2c11efb21c0242ac120006"
            ],
            "document_id": "5c5999ec7be811ef9cab0242ac120005",
            "id": "d78435d142bd5cf6704da62c778795c5",
            "important_keywords": []
        }
    }
}

"dataset_id" is array, but actually returned string

{
    "code": 0,
    "data": {
        "chunk": {
            "content": "1",
            "create_time": "2024-12-20 14:53:45",
            "create_timestamp": 1734677625.287646,
            "dataset_id": "8f1fa7b4be8611ef80430242ac180006",
            "document_id": "8f3d4440be8611ef921a0242ac180006",
            "id": "09618c175048e012",
            "important_keywords": [],
            "questions": []
        }
    }
}

Retrieve chunks

POST /api/v1/retrieval

current api docs response:

{
    "code": 0,
    "data": {
        "chunks": [
            {
                "content": "ragflow content",
                "content_ltks": "ragflow content",
                "document_id": "5c5999ec7be811ef9cab0242ac120005",
                "document_keyword": "1.txt",
                "highlight": "<em>ragflow</em> content",
                "id": "d78435d142bd5cf6704da62c778795c5",
                "image_id": "",
                "important_keywords": [
                    ""
                ],
                "kb_id": "c7ee74067a2c11efb21c0242ac120006",
                "positions": [
                    ""
                ],
                "similarity": 0.9669436601210759,
                "term_similarity": 1.0,
                "vector_similarity": 0.8898122004035864
            }
        ],
        "doc_aggs": [
            {
                "count": 1,
                "doc_id": "5c5999ec7be811ef9cab0242ac120005",
                "doc_name": "1.txt"
            }
        ],
        "total": 1
    }
}

"kb_id" is string, but actually returned string or array
88481734575722_ pic
88471734575718_ pic

List chunks

GET /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks?keywords={keywords}&page={page}&page_size={page_size}&id={id}

If id is passed, pageSize should be ignored

record not in page~pageSize return not found, example:
/api/v1/datasets/0213a6fe9d2711ef8fd00242ac160006/documents/195944049d2711ef83320242ac160006/chunks?page=1&page_size=10&id=c6a6348f8a3814bd501ee53e2cb827d1

{
    "code": 102,
    "message": "Can't find this chunk c6a6348f8a3814bd501ee53e2cb827d1"
}

page content include record It is normal, example:
/api/v1/datasets/0213a6fe9d2711ef8fd00242ac160006/documents/195944049d2711ef83320242ac160006/chunks?page=1&page_size=5000&id=c6a6348f8a3814bd501ee53e2cb827d1

{
    "code": 0,
    "data": {
        "chunks": [
            {
                "available": true,
                "content": "question:\n医院周边的安全状况如何?\nanswer:\n暂无信息",
                "docnm_kwd": "mxej90rj.txt",
                "document_id": "195944049d2711ef83320242ac160006",
                "id": "c6a6348f8a3814bd501ee53e2cb827d1",
                "image_id": "",
                "important_keywords": [],
                "positions": [],
                "questions": []
            }
        ],
        "doc": {
            "chunk_count": 100,
            "chunk_method": "naive",
            "create_date": "Fri, 08 Nov 2024 00:41:12 GMT",
            "create_time": 1730997672634,
            "created_by": "28f0b1ea9d2611ef84450242ac160006",
            "dataset_id": "0213a6fe9d2711ef8fd00242ac160006",
            "id": "195944049d2711ef83320242ac160006",
            "location": "mxej90rj.txt",
            "name": "mxej90rj.txt",
            "parser_config": {
                "chunk_token_num": 128,
                "delimiter": "\\n!?;。;!?",
                "html4excel": false,
                "layout_recognize": true,
                "raptor": {
                    "use_raptor": false
                }
            },
            "process_begin_at": null,
            "process_duation": 0.0,
            "progress": 0.0,
            "progress_msg": "",
            "run": "UNSTART",
            "size": 0,
            "source_type": "local",
            "status": "1",
            "thumbnail": "",
            "token_count": 4130,
            "type": "doc",
            "update_date": "Fri, 08 Nov 2024 00:42:19 GMT",
            "update_time": 1730997739897
        },
        "total": 100
    }
}

Expected behavior

No response

Steps to reproduce

invoke api

Additional information

No response

@majian159 majian159 added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants