Skip to main content

A Gradio custom component to display RAG sources

Project description


tags: [gradio-custom-component, ] title: gradio_rag_sources short_description: A Gradio custom component to display RAG sources colorFrom: blue colorTo: yellow sdk: gradio pinned: false app_file: space.py

gradio_rag_sources

PyPI - Version Static Badge

A Gradio custom component to display RAG sources

Installation

pip install gradio_rag_sources

Usage

import gradio as gr

from gradio_rag_sources import RagSourcesTable
from gradio_rag_sources import _RagSource as RagSource


with gr.Blocks() as demo:
    sources = [
        RagSource(
            url="https://www.idris.fr",
            retrievalScore=0.45,
            rerankScore=0.9,
        ),
        RagSource(
            url="https://www.google.fr",
            retrievalScore=0.45,
            rerankScore=0.95,
        ),
        RagSource(
            url="https://www.pytorch.org",
            retrievalScore=0.55,
            rerankScore=0.8,
        ),
    ]
    RagSourcesTable(value=sources)


if __name__ == "__main__":
    demo.launch()

RagSourcesTable

Initialization

name type default description
value
Any
None None
label
str | None
None None
info
str | None
None None
show_label
bool | None
None None
container
bool
True None
scale
int | None
None None
min_width
int | None
None None
interactive
bool | None
None None
visible
bool
True None
elem_id
str | None
None None
elem_classes
list[str] | str | None
None None
render
bool
True None
key
int | str | None
None None
load_fn
Callable | None
None None
every
Timer | float | None
None None
inputs
Component | Sequence[Component] | set[Component] | None
None None

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradio_rag_sources-0.1.2.tar.gz (77.2 kB view hashes)

Uploaded Source

Built Distribution

gradio_rag_sources-0.1.2-py3-none-any.whl (36.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page