From ef441093bf01475337fdedd702829a2140f73768 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Wed, 14 Aug 2024 16:57:32 +0000 Subject: [PATCH 1/7] lxml fix --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 315b612b6..95667746f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -38,7 +38,7 @@ SQLAlchemy mistune python-docx htmldocx -lxml[html_clean] +lxml_html_clean websockets unstructured pandas From 8b36f62356e4f8375b47602fc900c88f57d33d02 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Wed, 14 Aug 2024 17:06:26 +0000 Subject: [PATCH 2/7] build stabilized --- gpt_researcher/master/actions.py | 6 +++++- requirements.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gpt_researcher/master/actions.py b/gpt_researcher/master/actions.py index 1f5d2b2ce..d06e293b8 100644 --- a/gpt_researcher/master/actions.py +++ b/gpt_researcher/master/actions.py @@ -465,7 +465,11 @@ async def stream_output( None """ if not websocket or logging: - print(output) + try: + print(output) + except UnicodeEncodeError: + # Option 1: Replace problematic characters with a placeholder + print(output.encode('cp1252', errors='replace').decode('cp1252')) if websocket: await websocket.send_json( diff --git a/requirements.txt b/requirements.txt index 95667746f..cf1354f4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,6 +44,8 @@ unstructured pandas json_repair exa_py +json5 +langgraph # uncomment for testing # pytest From 5208cf9ccb216f51ed76cba5ac8014d13c6fcd52 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Wed, 14 Aug 2024 17:20:51 +0000 Subject: [PATCH 3/7] hybrid option added to nextjs app & runs to completion - reading from both docs & web :) --- multi_agents/frontend/components/Task/ResearchForm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/multi_agents/frontend/components/Task/ResearchForm.js b/multi_agents/frontend/components/Task/ResearchForm.js index 69c0a79ef..680d4cf25 100644 --- a/multi_agents/frontend/components/Task/ResearchForm.js +++ b/multi_agents/frontend/components/Task/ResearchForm.js @@ -40,6 +40,7 @@ export default function ResearchForm({ chatBoxSettings, setChatBoxSettings }) { {report_source === 'local' && report_type !== 'multi_agents' ? : null} From 5dba221ddf93d2b1f1208e081c4e8aa3a7d2fe55 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Wed, 14 Aug 2024 17:26:12 +0000 Subject: [PATCH 4/7] run with docker instructions on main readme --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 6731f5c5d..5bae2baa5 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,26 @@ report = await researcher.write_report() **For more examples and configurations, please refer to the [PIP documentation](https://docs.gptr.dev/docs/gpt-researcher/pip-package) page.** +## Run with Docker + +> **Step 1** - [Install Docker](https://docs.gptr.dev/docs/gpt-researcher/getting-started#try-it-with-docker) + +> **Step 2** - Clone the '.env.example' file, add your API Keys to the cloned file and save the file as '.env' + +> **Step 3** - Within the docker-compose file comment out services that you don't want to run with Docker. + +```bash +$ docker-compose up --build +``` + +> **Step 4** - By default, if you haven't uncommented anything in your docker-compose file, this flow will start 2 processes: + - the Python server running on localhost:8000
+ - the React app running on localhost:3000
+ +Visit localhost:3000 on any browser and enjoy researching! + + + ## 📄 Research on Local Documents You can instruct the GPT Researcher to run research tasks based on your local documents. Currently supported file formats are: PDF, plain text, CSV, Excel, Markdown, PowerPoint, and Word documents. From e70ccbc0328e961cc098e3a42890b8a61d55d515 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Thu, 15 Aug 2024 05:54:30 +0000 Subject: [PATCH 5/7] remove link to Docker docs (moved to main readme for optimized Dev Experience) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bae2baa5..635a00f62 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ python -m uvicorn main:app --reload
-**To learn how to get started with [Docker](https://docs.gptr.dev/docs/gpt-researcher/getting-started#try-it-with-docker), [Poetry](https://docs.gptr.dev/docs/gpt-researcher/getting-started#poetry) or a [virtual environment](https://docs.gptr.dev/docs/gpt-researcher/getting-started#virtual-environment) check out the [documentation](https://docs.gptr.dev/docs/gpt-researcher/getting-started) page.** +**To learn how to get started with [Poetry](https://docs.gptr.dev/docs/gpt-researcher/getting-started#poetry) or a [virtual environment](https://docs.gptr.dev/docs/gpt-researcher/getting-started#virtual-environment) check out the [documentation](https://docs.gptr.dev/docs/gpt-researcher/getting-started) page.** ### Run as PIP package ```bash From bee74f8ee3d5a2ac1df5b970365c4f9b70baa290 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Thu, 15 Aug 2024 06:08:10 +0000 Subject: [PATCH 6/7] show file upload box when report_source === 'hybrid' --- multi_agents/frontend/components/Settings/Modal.js | 2 +- multi_agents/frontend/components/Task/ResearchForm.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multi_agents/frontend/components/Settings/Modal.js b/multi_agents/frontend/components/Settings/Modal.js index cab48004d..7856a0a42 100644 --- a/multi_agents/frontend/components/Settings/Modal.js +++ b/multi_agents/frontend/components/Settings/Modal.js @@ -126,7 +126,7 @@ export default function Modal({ setChatBoxSettings, chatBoxSettings }) {
- + {/* */}
{activeTab === 'search' && (
diff --git a/multi_agents/frontend/components/Task/ResearchForm.js b/multi_agents/frontend/components/Task/ResearchForm.js index 680d4cf25..ea2863e2a 100644 --- a/multi_agents/frontend/components/Task/ResearchForm.js +++ b/multi_agents/frontend/components/Task/ResearchForm.js @@ -43,7 +43,7 @@ export default function ResearchForm({ chatBoxSettings, setChatBoxSettings }) {
- {report_source === 'local' && report_type !== 'multi_agents' ? : null} + {report_source === 'local' || report_source === 'hybrid' ? : null} {/* Add ToneSelector component */} ); From 4f0b3299f836ca3800c5e1c65ea846755c7aab60 Mon Sep 17 00:00:00 2001 From: ElishaKay Date: Thu, 15 Aug 2024 06:11:32 +0000 Subject: [PATCH 7/7] bring back api variables button --- multi_agents/frontend/components/Settings/Modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multi_agents/frontend/components/Settings/Modal.js b/multi_agents/frontend/components/Settings/Modal.js index 7856a0a42..cab48004d 100644 --- a/multi_agents/frontend/components/Settings/Modal.js +++ b/multi_agents/frontend/components/Settings/Modal.js @@ -126,7 +126,7 @@ export default function Modal({ setChatBoxSettings, chatBoxSettings }) {
- {/* */} +
{activeTab === 'search' && (