Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize master #755

Merged
merged 7 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ python -m uvicorn main:app --reload

<br />

**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
Expand All @@ -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<br>
- the React app running on localhost:3000<br>

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.
Expand Down
6 changes: 5 additions & 1 deletion gpt_researcher/master/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion multi_agents/frontend/components/Task/ResearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ export default function ResearchForm({ chatBoxSettings, setChatBoxSettings }) {
<select name="report_source" value={report_source} onChange={onFormChange} className="form-control" required>
<option value="web">The Internet</option>
<option value="local">My Documents</option>
<option value="hybrid">Hybrid</option>
</select>
</div>
{report_source === 'local' && report_type !== 'multi_agents' ? <FileUpload /> : null}
{report_source === 'local' || report_source === 'hybrid' ? <FileUpload /> : null}
<ToneSelector tone={tone} onToneChange={onToneChange} /> {/* Add ToneSelector component */}
</form>
);
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ SQLAlchemy
mistune
python-docx
htmldocx
lxml[html_clean]
lxml_html_clean
websockets
unstructured
pandas
json_repair
exa_py
json5
langgraph

# uncomment for testing
# pytest
Expand Down