---
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`
<a href="https://pypi.org/project/gradio_rag_sources/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_rag_sources"></a> <a href="https://github.com/ncassereau-idris/gradio_rag_sources/issues" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/Issues-white?logo=github&logoColor=black"></a>
A Gradio custom component to display RAG sources
## Installation
```bash
pip install gradio_rag_sources
```
## Usage
```python
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
<table>
<thead>
<tr>
<th align="left">name</th>
<th align="left" style="width: 25%;">type</th>
<th align="left">default</th>
<th align="left">description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>value</code></td>
<td align="left" style="width: 25%;">
```python
Any
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>label</code></td>
<td align="left" style="width: 25%;">
```python
str | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>info</code></td>
<td align="left" style="width: 25%;">
```python
str | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>show_label</code></td>
<td align="left" style="width: 25%;">
```python
bool | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>container</code></td>
<td align="left" style="width: 25%;">
```python
bool
```
</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>scale</code></td>
<td align="left" style="width: 25%;">
```python
int | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>min_width</code></td>
<td align="left" style="width: 25%;">
```python
int | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>interactive</code></td>
<td align="left" style="width: 25%;">
```python
bool | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>visible</code></td>
<td align="left" style="width: 25%;">
```python
bool
```
</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>elem_id</code></td>
<td align="left" style="width: 25%;">
```python
str | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>elem_classes</code></td>
<td align="left" style="width: 25%;">
```python
list[str] | str | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>render</code></td>
<td align="left" style="width: 25%;">
```python
bool
```
</td>
<td align="left"><code>True</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>key</code></td>
<td align="left" style="width: 25%;">
```python
int | str | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>load_fn</code></td>
<td align="left" style="width: 25%;">
```python
Callable | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>every</code></td>
<td align="left" style="width: 25%;">
```python
Timer | float | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
<tr>
<td align="left"><code>inputs</code></td>
<td align="left" style="width: 25%;">
```python
Component | Sequence[Component] | set[Component] | None
```
</td>
<td align="left"><code>None</code></td>
<td align="left">None</td>
</tr>
</tbody></table>
Raw data
{
"_id": null,
"home_page": null,
"name": "gradio-rag-sources",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "gradio-custom-component, gradio-template-Fallback",
"author": null,
"author_email": "Nathan Cassereau <nathan@cassereau.fr>",
"download_url": "https://files.pythonhosted.org/packages/b6/14/b86b31b4ab2c52fa85983e8077ad6383f7f13ae905b9a1601ad2c1f93018/gradio_rag_sources-0.1.2.tar.gz",
"platform": null,
"description": "---\ntags: [gradio-custom-component, ]\ntitle: gradio_rag_sources\nshort_description: A Gradio custom component to display RAG sources\ncolorFrom: blue\ncolorTo: yellow\nsdk: gradio\npinned: false\napp_file: space.py\n---\n\n# `gradio_rag_sources`\n<a href=\"https://pypi.org/project/gradio_rag_sources/\" target=\"_blank\"><img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/gradio_rag_sources\"></a> <a href=\"https://github.com/ncassereau-idris/gradio_rag_sources/issues\" target=\"_blank\"><img alt=\"Static Badge\" src=\"https://img.shields.io/badge/Issues-white?logo=github&logoColor=black\"></a> \n\nA Gradio custom component to display RAG sources\n\n## Installation\n\n```bash\npip install gradio_rag_sources\n```\n\n## Usage\n\n```python\nimport gradio as gr\n\nfrom gradio_rag_sources import RagSourcesTable\nfrom gradio_rag_sources import _RagSource as RagSource\n\n\nwith gr.Blocks() as demo:\n sources = [\n RagSource(\n url=\"https://www.idris.fr\",\n retrievalScore=0.45,\n rerankScore=0.9,\n ),\n RagSource(\n url=\"https://www.google.fr\",\n retrievalScore=0.45,\n rerankScore=0.95,\n ),\n RagSource(\n url=\"https://www.pytorch.org\",\n retrievalScore=0.55,\n rerankScore=0.8,\n ),\n ]\n RagSourcesTable(value=sources)\n\n\nif __name__ == \"__main__\":\n demo.launch()\n\n```\n\n## `RagSourcesTable`\n\n### Initialization\n\n<table>\n<thead>\n<tr>\n<th align=\"left\">name</th>\n<th align=\"left\" style=\"width: 25%;\">type</th>\n<th align=\"left\">default</th>\n<th align=\"left\">description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>value</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nAny\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>info</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>show_label</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>container</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>scale</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>min_width</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>interactive</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>visible</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_id</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nstr | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>elem_classes</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nlist[str] | str | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>render</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nbool\n```\n\n</td>\n<td align=\"left\"><code>True</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>key</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nint | str | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>load_fn</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nCallable | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>every</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nTimer | float | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n\n<tr>\n<td align=\"left\"><code>inputs</code></td>\n<td align=\"left\" style=\"width: 25%;\">\n\n```python\nComponent | Sequence[Component] | set[Component] | None\n```\n\n</td>\n<td align=\"left\"><code>None</code></td>\n<td align=\"left\">None</td>\n</tr>\n</tbody></table>\n\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A Gradio custom component to display RAG sources",
"version": "0.1.2",
"project_urls": {
"repository": "https://github.com/ncassereau-idris/gradio_rag_sources"
},
"split_keywords": [
"gradio-custom-component",
" gradio-template-fallback"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1e7610587cc77f0e0ae98a064e41087570ab9b8d2007361e4c6e556f36b58654",
"md5": "a416f530dac5463ce156445e1fd5c69e",
"sha256": "82ab9c2a059d1e67b8dd6df18f2f5b5e8a9d480565e0907f93e3f1b911612112"
},
"downloads": -1,
"filename": "gradio_rag_sources-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a416f530dac5463ce156445e1fd5c69e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 36160,
"upload_time": "2024-08-26T15:33:16",
"upload_time_iso_8601": "2024-08-26T15:33:16.216236Z",
"url": "https://files.pythonhosted.org/packages/1e/76/10587cc77f0e0ae98a064e41087570ab9b8d2007361e4c6e556f36b58654/gradio_rag_sources-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b614b86b31b4ab2c52fa85983e8077ad6383f7f13ae905b9a1601ad2c1f93018",
"md5": "da5123bc8448cd7a348a269c3062c989",
"sha256": "7301d52a258e0621bf98e9fc7e8dfd3e3a9d862dd9a032e692569d36e2100c09"
},
"downloads": -1,
"filename": "gradio_rag_sources-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "da5123bc8448cd7a348a269c3062c989",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 77172,
"upload_time": "2024-08-26T15:33:17",
"upload_time_iso_8601": "2024-08-26T15:33:17.891329Z",
"url": "https://files.pythonhosted.org/packages/b6/14/b86b31b4ab2c52fa85983e8077ad6383f7f13ae905b9a1601ad2c1f93018/gradio_rag_sources-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-26 15:33:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ncassereau-idris",
"github_project": "gradio_rag_sources",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "gradio-rag-sources"
}