diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b83ed69..e69228c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,41 +1,45 @@
# Welcome to DocsGPT Contributing Guidelines
-Thank you for choosing this project to contribute to. We are all very grateful!
+Thank you for choosing to contribute to DocsGPT! We are all very grateful!
### [π Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! π](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md)
# We accept different types of contributions
-π£ **Discussions** - where you can start a new topic or answer some questions
+π£ **Discussions** - Engage in conversations, start new topics, or help answer questions.
-π **Issues** - This is how we track tasks, sometimes it is bugs that need fixing, and sometimes it is new features
+π **Issues** - This is where we keep track of tasks. It could be bugs,fixes or suggestions for new features.
-π οΈ **Pull requests** - This is how you can suggest changes to our repository, to work on existing issues or add new features
+π οΈ **Pull requests** - Suggest changes to our repository, either by working on existing issues or adding new features.
-π **Wiki** - where we have our documentation
+π **Wiki** - This is where our documentation resides.
## π Issues and Pull requests
-We value contributions to our issues in the form of discussion or suggestions. We recommend that you check out existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2).
+We value contributions in the form of discussions or suggestions. We recommend taking a look at existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2).
-If you want to contribute by writing code, there are a few things that you should know before doing it:
+Before creating issues, please check out how the latest version of our app looks and works by launching it via [Quickstart](https://github.com/arc53/DocsGPT#quickstart) the version on our live demo is slightly modified with login. Your issues should relate to the version that you can launch via [Quickstart](https://github.com/arc53/DocsGPT#quickstart).
+
+If you're interested in contributing code, here are some important things to know:
+
+We have a frontend built with React (Vite) and a backend in Python.
-We have a frontend in React (Vite) and backend in Python.
### If you are looking to contribute to frontend (βοΈReact, Vite):
-- The current frontend is being migrated from `/application` to `/frontend` with a new design, so please contribute to the new one.
+- The current frontend is being migrated from [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) to [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) with a new design, so please contribute to the new one.
- Check out this [milestone](https://github.com/arc53/DocsGPT/milestone/1) and its issues.
- The Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1).
Please try to follow the guidelines.
### If you are looking to contribute to Backend (π Python):
-- Check out our issues and contribute to `/application` or `/scripts` (ignore old `ingest_rst.py` `ingest_rst_sphinx.py` files; they will be deprecated soon).
-- All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder.
-- Before submitting your PR, ensure it is queryable after ingesting some test data.
+- Review our issues and contribute to [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts) (please disregard old [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py) files; they will be deprecated soon).
+- All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder.
+- Before submitting your Pull Request, ensure it can be queried after ingesting some test data.
+
### Testing
To run unit tests from the root of the repository, execute:
@@ -43,10 +47,11 @@ To run unit tests from the root of the repository, execute:
python -m pytest
```
-### Workflow:
-Create a fork, make changes on your forked repository, and submit changes as a pull request.
+### Workflow π :
+- Fork repository
+- Make the required changes on your forked version
+- Commit those changes and submit those as a pull request so that it reflects on thr main repository.
## Questions/collaboration
-Please join our [Discord](https://discord.gg/n5BX8dh8rU). Don't hesitate; we are very friendly and welcoming to new contributors.
-
+Feel free to join our [Discord](https://discord.gg/n5BX8dh8rU). We're very friendly and welcoming to new contributors, so don't hesitate to reach out.
# Thank you so much for considering contributing to DocsGPT!π
diff --git a/HACKTOBERFEST.md b/HACKTOBERFEST.md
index 1a39e56..b164661 100644
--- a/HACKTOBERFEST.md
+++ b/HACKTOBERFEST.md
@@ -17,14 +17,14 @@ Familiarize yourself with the current contributions and our [Roadmap](https://gi
Deciding to contribute with code? Here are some insights based on the area of your interest:
- Frontend (βοΈReact, Vite):
- - Most of the code is located in `/frontend` folder. You can also check out our React extension in /extensions/react-widget.
+ - Most of the code is located in [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. You can also check out our React extension in [`/extensions/react-widget`](https://github.com/arc53/DocsGPT/tree/main/extensions/react-widget).
- For design references, here's the [Figma](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1).
- Ensure you adhere to the established guidelines.
- Backend (πPython):
- - Focus on `/application` or `/scripts`. However, avoid the files ingest_rst.py and ingest_rst_sphinx.py, as they will soon be deprecated.
+ - Focus on [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts). However, avoid the files [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) and [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py), as they will soon be deprecated.
- Newly added code should come with relevant unit tests (pytest).
- - Refer to the `/tests` folder for test suites.
+ - Refer to the [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder for test suites.
Check out our [Contributing Guidelines](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md)
diff --git a/README.md b/README.md
index 0fa6a7a..db56186 100644
--- a/README.md
+++ b/README.md
@@ -7,9 +7,9 @@
- DocsGPT is a cutting-edge open-source solution that streamlines the process of finding information in project documentation. With its integration of the powerful GPT models, developers can easily ask questions about a project and receive accurate answers.
+ DocsGPT is a cutting-edge open-source solution that streamlines the process of finding information in project documentation. With its integration of the powerful GPT models, developers can easily ask questions about a project and receive accurate answers.
-Say goodbye to time-consuming manual searches, and let DocsGPT help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.
+Say goodbye to time-consuming manual searches, and let DocsGPT help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.
Welcome to DocsGPT, your technical documentation assistant!
-
+
Enter a query related to the information in the documentation you
- selected to receive and we will provide you with the most relevant
- answers.
+ selected to receive
+ and we will provide you with the most relevant answers.
-
+
Start by entering your query in the input field below and we will do the
rest!
-
-
-
-
-
- Chat with Your Data
-
-
+
+
+
+
+
Chat with Your Data
+
DocsGPT will use your data to answer questions. Whether its
documentation, source code, or Microsoft files, DocsGPT allows you
to have interactive conversations and find answers based on the
@@ -33,13 +35,11 @@ export default function Hero({ className = '' }: { className?: string }) {
-
-
-
-
- Secure Data Storage
-
-
+
+
+
+
Secure Data Storage
+
The security of your data is our top priority. DocsGPT ensures the
utmost protection for your sensitive information. With secure data
storage and privacy measures in place, you can trust that your
@@ -47,17 +47,15 @@ export default function Hero({ className = '' }: { className?: string }) {
-
-
+
+
-
- Open Source Code
-
-
+
Open Source Code
+
DocsGPT is built on open source principles, promoting transparency
and collaboration. The source code is freely available, enabling
developers to contribute, enhance, and customize the app to meet
diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx
index e6c5bb6..e236b8a 100644
--- a/frontend/src/Navigation.tsx
+++ b/frontend/src/Navigation.tsx
@@ -32,6 +32,7 @@ import { useMediaQuery, useOutsideAlerter } from './hooks';
import Upload from './upload/Upload';
import { Doc, getConversations } from './preferences/preferenceApi';
import SelectDocsModal from './preferences/SelectDocsModal';
+import ConversationTile from './conversation/ConversationTile';
interface NavigationProps {
navOpen: boolean;
@@ -68,27 +69,26 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
useEffect(() => {
if (!conversations) {
- getConversations()
- .then((fetchedConversations) => {
- dispatch(setConversations(fetchedConversations));
- })
- .catch((error) => {
- console.error('Failed to fetch conversations: ', error);
- });
+ fetchConversations();
}
}, [conversations, dispatch]);
+ async function fetchConversations() {
+ return await getConversations()
+ .then((fetchedConversations) => {
+ dispatch(setConversations(fetchedConversations));
+ })
+ .catch((error) => {
+ console.error('Failed to fetch conversations: ', error);
+ });
+ }
+
const handleDeleteConversation = (id: string) => {
fetch(`${apiHost}/api/delete_conversation?id=${id}`, {
method: 'POST',
})
.then(() => {
- // remove the image element from the DOM
- const imageElement = document.querySelector(
- `#img-${id}`,
- ) as HTMLElement;
- const parentElement = imageElement.parentNode as HTMLElement;
- parentElement.parentNode?.removeChild(parentElement);
+ fetchConversations();
})
.catch((error) => console.error(error));
};
@@ -126,6 +126,29 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
);
});
};
+
+ async function updateConversationName(updatedConversation: {
+ name: string;
+ id: string;
+ }) {
+ await fetch(`${apiHost}/api/update_conversation_name`, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(updatedConversation),
+ })
+ .then((response) => response.json())
+ .then((data) => {
+ if (data) {
+ navigate('/');
+ fetchConversations();
+ }
+ })
+ .catch((err) => {
+ console.error(err);
+ });
+ }
useOutsideAlerter(
navRef,
() => {
@@ -210,41 +233,17 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) {
+ );
+}
diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs
index 8e395a0..b76b022 100644
--- a/frontend/tailwind.config.cjs
+++ b/frontend/tailwind.config.cjs
@@ -1,6 +1,7 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
+ darkMode: 'class',
theme: {
extend: {
spacing: {
diff --git a/scripts/ingest.py b/scripts/ingest.py
index 6ab9cce..8c74fd0 100644
--- a/scripts/ingest.py
+++ b/scripts/ingest.py
@@ -78,14 +78,12 @@ def ingest(yes: bool = typer.Option(False, "-y", "--yes", prompt=False,
# Here we check for command line arguments for bot calls.
# If no argument exists or the yes is not True, then the
# user permission is requested to call the API.
- if len(sys.argv) > 1:
- if yes:
- call_openai_api(docs, folder_name)
- else:
- get_user_permission(docs, folder_name)
+ if len(sys.argv) > 1 and yes:
+ call_openai_api(docs, folder_name)
else:
get_user_permission(docs, folder_name)
+
folder_counts = defaultdict(int)
folder_names = []
for dir_path in dir:
@@ -110,14 +108,19 @@ def convert(dir: Optional[str] = typer.Option("inputs",
Creates documentation linked to original functions from specified location.
By default /inputs folder is used, .py is parsed.
"""
- if formats == 'py':
- functions_dict, classes_dict = extract_py(dir)
- elif formats == 'js':
- functions_dict, classes_dict = extract_js(dir)
- elif formats == 'java':
- functions_dict, classes_dict = extract_java(dir)
+ # Using a dictionary to map between the formats and their respective extraction functions
+ # makes the code more scalable. When adding more formats in the future,
+ # you only need to update the extraction_functions dictionary.
+ extraction_functions = {
+ 'py': extract_py,
+ 'js': extract_js,
+ 'java': extract_java
+ }
+
+ if formats in extraction_functions:
+ functions_dict, classes_dict = extraction_functions[formats](dir)
else:
- raise Exception("Sorry, language not supported yet")
+ raise Exception("Sorry, language not supported yet")
transform_to_docs(functions_dict, classes_dict, formats, dir)