mirror of
https://github.com/assafelovic/gpt-researcher.git
synced 2024-04-09 14:09:35 +03:00
27 lines
630 B
Python
27 lines
630 B
Python
from gpt_researcher import GPTResearcher
|
|
import asyncio
|
|
|
|
|
|
async def main():
|
|
"""
|
|
This is a sample script that shows how to run a research report.
|
|
"""
|
|
# Query
|
|
query = "What happened in the latest burning man floods?"
|
|
|
|
# Report Type
|
|
report_type = "research_report"
|
|
|
|
# Initialize the researcher
|
|
researcher = GPTResearcher(query=query, report_type=report_type, config_path=None)
|
|
# Conduct research on the given query
|
|
researcher.conduct_research()
|
|
# Write the report
|
|
report = await researcher.write_report()
|
|
|
|
return report
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|