Skip to main content

Examples

Run PIP Package

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
await researcher.conduct_research()
# Write the report
report = await researcher.write_report()

return report


if __name__ == "__main__":
asyncio.run(main())