assafelovic / gpt-researcher

LLM based autonomous agent that does online comprehensive research on any given topic
https://gptr.dev
Apache License 2.0
14.27k stars 1.86k forks source link

pass config.json to GPTResearcher #489

Closed saeid976 closed 4 months ago

saeid976 commented 4 months ago

hi, i want to pass config.json into GPTResearcher like: researcher = GPTResearcher(query=query, report_type="research_report", config_path='config.json')

but the GPTResearcher uses the default config.why?

the json file is: {   "SEARCH_RETRIEVER": "serpapi",   "EMBEDDING_PROVIDER": "azureopenai",   "LLM_PROVIDER": "azureopenai",   "FAST_LLM_MODEL": "gpt_35_16k",   "SMART_LLM_MODEL": "gpt_35_16k",   "FAST_TOKEN_LIMIT": 2000,   "SMART_TOKEN_LIMIT": 4000,   "BROWSE_CHUNK_MAX_LENGTH": 8192,   "SUMMARY_TOKEN_LIMIT": 700,   "TEMPERATURE": 0.2,   "USER_AGENT": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0",   "MAX_SEARCH_RESULTS_PER_QUERY": 5,   "MEMORY_BACKEND": "local",   "TOTAL_WORDS": 1000,   "REPORT_FORMAT": "APA",   "MAX_ITERATIONS": 3,   "AGENT_ROLE": "None",   "SCRAPER": "bs",   "MAX_SUBTOPICS": 3 }

how can I fixed it?

assafelovic commented 4 months ago

Hey @saeid976 thanks for catching this. I pushed a fix so please upgrade to latest GPT using pip install -U gpt-researcher and try again. Please note that instead of search_retriever you should pass retriever. Lmk!