From b901321313ea4d49e28a12e0c8a43bd5201d5732 Mon Sep 17 00:00:00 2001 From: ddegtyarev-devfactory Date: Mon, 9 Dec 2024 23:13:15 +0500 Subject: [PATCH 1/2] Fixed ChatBedrock invocation --- gpt_researcher/llm_provider/generic/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpt_researcher/llm_provider/generic/base.py b/gpt_researcher/llm_provider/generic/base.py index e7c8e2814..2b5fdd25f 100644 --- a/gpt_researcher/llm_provider/generic/base.py +++ b/gpt_researcher/llm_provider/generic/base.py @@ -100,7 +100,7 @@ def from_provider(cls, provider: str, **kwargs: Any): if "model" in kwargs or "model_name" in kwargs: model_id = kwargs.pop("model", None) or kwargs.pop("model_name", None) - kwargs = {"model_id": model_id, **kwargs} + kwargs = {"model_id": model_id, "model_kwargs": kwargs} llm = ChatBedrock(**kwargs) else: supported = ", ".join(_SUPPORTED_PROVIDERS) From 10e04a2a6d7f8ee7730ad60e0d69e741bb2104ae Mon Sep 17 00:00:00 2001 From: ddegtyarev-devfactory Date: Mon, 9 Dec 2024 23:13:44 +0500 Subject: [PATCH 2/2] Create output directory if it doesn't exist --- cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli.py b/cli.py index ea796fe6f..25fb21ce5 100644 --- a/cli.py +++ b/cli.py @@ -12,6 +12,7 @@ import argparse from argparse import RawTextHelpFormatter from uuid import uuid4 +import os from dotenv import load_dotenv @@ -92,6 +93,7 @@ async def main(args): # Write the report to a file artifact_filepath = f"outputs/{uuid4()}.md" + os.makedirs("outputs", exist_ok=True) with open(artifact_filepath, "w") as f: f.write(report)