Skip to content

Commit 7a6e7cd

Browse files
committed
Incorporate review suggestions
1 parent f3f59a3 commit 7a6e7cd

File tree

12 files changed

+260
-27
lines changed

12 files changed

+260
-27
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ env:
1818
- "dependabot/**"
1919
- "gh-readonly-queue/**"
2020
- "renovate/**"
21-
# - "tickets/**"
22-
# - "u/**"
21+
- "tickets/**"
22+
- "u/**"
2323
release:
2424
types: [published]
2525

python/rubin/__init__.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
"""pkgutil-style namespace package."""
1+
# This file is part of rubin_rag.
2+
#
3+
# Developed for the LSST Data Management System.
4+
# This product includes software developed by the LSST Project
5+
# (https://www.lsst.org).
6+
# See the COPYRIGHT file at the top-level directory of this distribution
7+
# for details of code ownership.
8+
#
9+
# This program is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation, either version 3 of the License, or
12+
# (at your option) any later version.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
221

322
import pkgutil
423

python/rubin/rag/__init__.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
"""Rubin RAG-basd LLM Application."""
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Define and retrieve the version string for the package."""
224

325
from importlib.metadata import PackageNotFoundError, version
426

python/rubin/rag/app.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1-
"""Sets up and manages the interactive chatbot interface for the bot,
2-
using Streamlit.
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Set up the Streamlit interface for the chatbot, configuring the
24+
retriever, QA chain, session state, UI elements, and handling user of
25+
interactions.
326
"""
427

528
from pathlib import Path

python/rubin/rag/chatbot.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1-
"""Integrates using Weaviate, LangChain, and OpenAI's GPT-4 to
2-
facilitate an interactive chatbot.
3-
4-
It includes functions for:
5-
- Setting up the Weaviate retriever and configuring the environment.
6-
- Creating a question-answering (QA) chain to process user input using a
7-
conversational model.
8-
- Handling user input, managing message history, and filtering responses
9-
based on specific sources.
10-
- Interacting with the Streamlit interface to display the chatbot's responses
11-
and source information.
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Set up a Streamlit-based chatbot using Weaviate for vector search and
24+
GPT-4o-mini for answering user queries.
1225
"""
1326

1427
import os

python/rubin/rag/custom_weaviate_vector_store.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
"""Overrides the similarity search function in WeaviateVectorStore."""
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Override the similarity search function in WeaviateVectorStore and
24+
return documents with their corresponding similarity scores.
25+
"""
226

327
from collections.abc import Callable
428
from typing import Any
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This file is part of rubin_rag.
2+
#
3+
# Developed for the LSST Data Management System.
4+
# This product includes software developed by the LSST Project
5+
# (https://www.lsst.org).
6+
# See the COPYRIGHT file at the top-level directory of this distribution
7+
# for details of code ownership.
8+
#
9+
# This program is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation, either version 3 of the License, or
12+
# (at your option) any later version.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program. If not, see <https://www.gnu.org/licenses/>.

python/rubin/rag/extra_scripts/parse_confluence.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
"""Loads documents from Confluence, processes them, and uploads
2-
them to Weaviate.
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Load Confluence documents, process metadata, and upload them to Weaviate
24+
with optional chunking.
325
"""
426

527
from langchain.document_loaders import ConfluenceLoader

python/rubin/rag/extra_scripts/parse_jira_tickets.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
"""Loads information from Jira tickets and uploads them to Weaviate."""
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Fetch and process JIRA ticket data, extract relevant details, and
24+
save results in a structured JSON format.
25+
"""
226

327
import json
428
import time

python/rubin/rag/extra_scripts/universal_weaviate_uploader.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
"""Uploads documents to Weaviate after optionally splitting them
2-
into smaller chunks and generating embeddings using OpenAI's API.
1+
#
2+
# This file is part of rubin_rag.
3+
#
4+
# Developed for the LSST Data Management System.
5+
# This product includes software developed by the LSST Project
6+
# (https://www.lsst.org).
7+
# See the COPYRIGHT file at the top-level directory of this distribution
8+
# for details of code ownership.
9+
#
10+
# This program is free software: you can redistribute it and/or modify
11+
# it under the terms of the GNU General Public License as published by
12+
# the Free Software Foundation, either version 3 of the License, or
13+
# (at your option) any later version.
14+
#
15+
# This program is distributed in the hope that it will be useful,
16+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
# GNU General Public License for more details.
19+
#
20+
# You should have received a copy of the GNU General Public License
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
23+
"""Upload documents to Weaviate using OpenAI embeddings, optionally
24+
splitting them into smaller chunks before storage.
325
"""
426

527
import os

0 commit comments

Comments
 (0)