Skip to content

[Feature Request]: top_n for /api/v1/retrieval #5481

Open
@chminsc

Description

@chminsc

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

Describe the feature you'd like

sometimes I need retrieval chunks for GPTs schema usage. But default api for retrieval returns all the chunks found. please and top_n for this api.

    top_n = req.get("top_n")
    if top_n and isinstance(top_n, int) and top_n > 0:
        ranks["chunks"] = ranks["chunks"][:top_n]

thanks!

Describe implementation you've considered

    top_n = req.get("top_n")
    if top_n and isinstance(top_n, int) and top_n > 0:
        ranks["chunks"] = ranks["chunks"][:top_n]

in api/apps/sdk/doc.py

Documentation, adoption, use case

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions