From e9e03e93fd11564875dcdc6c159ea014e51e630e Mon Sep 17 00:00:00 2001 From: Assaf Elovic Date: Mon, 14 Oct 2024 11:33:16 +0300 Subject: [PATCH] updated relative paths --- gpt_researcher/config/variables/default.py | 4 ++-- gpt_researcher/context/compression.py | 6 +++--- .../master/actions/query_processing.py | 6 ++---- .../master/actions/report_generation.py | 10 +++++----- gpt_researcher/master/actions/retriever.py | 2 +- gpt_researcher/master/actions/utils.py | 2 +- gpt_researcher/master/actions/web_scraping.py | 6 +++--- .../master/agent/context_manager.py | 8 ++++---- gpt_researcher/master/agent/master.py | 20 +++++++++---------- gpt_researcher/master/agent/researcher.py | 8 ++++---- gpt_researcher/master/agent/scraper.py | 2 +- gpt_researcher/master/agent/writer.py | 4 ++-- gpt_researcher/master/prompts.py | 2 +- 13 files changed, 39 insertions(+), 41 deletions(-) diff --git a/gpt_researcher/config/variables/default.py b/gpt_researcher/config/variables/default.py index de06df90d..f4d80aad8 100644 --- a/gpt_researcher/config/variables/default.py +++ b/gpt_researcher/config/variables/default.py @@ -1,5 +1,5 @@ -from gpt_researcher.config.variables.retrievers import RetrieversConfig, VALID_RETRIEVERS -from gpt_researcher.config.variables.base import BaseConfig +from .retrievers import RetrieversConfig, VALID_RETRIEVERS +from .base import BaseConfig class DefaultConfig(BaseConfig): diff --git a/gpt_researcher/context/compression.py b/gpt_researcher/context/compression.py index 71984a020..fe5413176 100644 --- a/gpt_researcher/context/compression.py +++ b/gpt_researcher/context/compression.py @@ -10,9 +10,9 @@ EmbeddingsFilter, ) from langchain.text_splitter import RecursiveCharacterTextSplitter -from gpt_researcher.vector_store import VectorStoreWrapper -from gpt_researcher.utils.costs import estimate_embedding_cost -from gpt_researcher.memory.embeddings import OPENAI_EMBEDDING_MODEL +from ..vector_store import VectorStoreWrapper +from ..utils.costs import estimate_embedding_cost +from ..memory.embeddings import OPENAI_EMBEDDING_MODEL class VectorstoreCompressor: diff --git a/gpt_researcher/master/actions/query_processing.py b/gpt_researcher/master/actions/query_processing.py index 231c5e540..4dbdb4627 100644 --- a/gpt_researcher/master/actions/query_processing.py +++ b/gpt_researcher/master/actions/query_processing.py @@ -1,10 +1,8 @@ import json import re import json_repair -from typing import List, Dict, Any -from gpt_researcher.config.config import Config -from gpt_researcher.utils.llm import create_chat_completion -from gpt_researcher.master.prompts import auto_agent_instructions, generate_search_queries_prompt +from ...utils.llm import create_chat_completion +from ..prompts import auto_agent_instructions, generate_search_queries_prompt async def choose_agent( diff --git a/gpt_researcher/master/actions/report_generation.py b/gpt_researcher/master/actions/report_generation.py index 72e717d9a..ee7a2bd5d 100644 --- a/gpt_researcher/master/actions/report_generation.py +++ b/gpt_researcher/master/actions/report_generation.py @@ -1,15 +1,15 @@ import asyncio from typing import List, Dict, Any -from gpt_researcher.config.config import Config -from gpt_researcher.utils.llm import create_chat_completion -from gpt_researcher.utils.logger import get_formatted_logger -from gpt_researcher.master.prompts import ( +from ...config.config import Config +from ...utils.llm import create_chat_completion +from ...utils.logger import get_formatted_logger +from ..prompts import ( generate_report_introduction, generate_draft_titles_prompt, generate_report_conclusion, get_prompt_by_report_type, ) -from gpt_researcher.utils.enum import Tone +from ...utils.enum import Tone logger = get_formatted_logger() diff --git a/gpt_researcher/master/actions/retriever.py b/gpt_researcher/master/actions/retriever.py index cdd296169..3a956f375 100644 --- a/gpt_researcher/master/actions/retriever.py +++ b/gpt_researcher/master/actions/retriever.py @@ -1,5 +1,5 @@ from typing import List, Type -from gpt_researcher.config.config import Config +from ...config.config import Config def get_retriever(retriever): """ diff --git a/gpt_researcher/master/actions/utils.py b/gpt_researcher/master/actions/utils.py index 2816175af..15ad710e1 100644 --- a/gpt_researcher/master/actions/utils.py +++ b/gpt_researcher/master/actions/utils.py @@ -1,6 +1,6 @@ from typing import Dict, Any, Callable from fastapi import WebSocket -from gpt_researcher.utils.logger import get_formatted_logger +from ...utils.logger import get_formatted_logger logger = get_formatted_logger() diff --git a/gpt_researcher/master/actions/web_scraping.py b/gpt_researcher/master/actions/web_scraping.py index a7e4b89ba..cba26a725 100644 --- a/gpt_researcher/master/actions/web_scraping.py +++ b/gpt_researcher/master/actions/web_scraping.py @@ -1,8 +1,8 @@ import asyncio from typing import List, Dict, Any -from gpt_researcher.scraper.scraper import Scraper -from gpt_researcher.config.config import Config -from gpt_researcher.utils.logger import get_formatted_logger +from ...scraper.scraper import Scraper +from ...config.config import Config +from ...utils.logger import get_formatted_logger logger = get_formatted_logger() diff --git a/gpt_researcher/master/agent/context_manager.py b/gpt_researcher/master/agent/context_manager.py index 41c25dd90..11ee3a9be 100644 --- a/gpt_researcher/master/agent/context_manager.py +++ b/gpt_researcher/master/agent/context_manager.py @@ -1,10 +1,10 @@ import asyncio from typing import List, Dict, Optional, Set -from gpt_researcher.context.compression import ContextCompressor, WrittenContentCompressor, VectorstoreCompressor -from gpt_researcher.document import DocumentLoader, LangChainDocumentLoader -from gpt_researcher.utils.enum import ReportSource -from gpt_researcher.master.actions.utils import stream_output +from ...context.compression import ContextCompressor, WrittenContentCompressor, VectorstoreCompressor +from ...document import DocumentLoader, LangChainDocumentLoader +from ...utils.enum import ReportSource +from ..actions.utils import stream_output class ContextManager: diff --git a/gpt_researcher/master/agent/master.py b/gpt_researcher/master/agent/master.py index 0317f3450..4eabff762 100644 --- a/gpt_researcher/master/agent/master.py +++ b/gpt_researcher/master/agent/master.py @@ -1,15 +1,15 @@ from typing import Optional, List, Dict, Any, Set -from gpt_researcher.config import Config -from gpt_researcher.memory import Memory -from gpt_researcher.utils.enum import ReportSource, ReportType, Tone -from gpt_researcher.llm_provider import GenericLLMProvider -from gpt_researcher.master.agent.researcher import ResearchConductor -from gpt_researcher.master.agent.scraper import ReportScraper -from gpt_researcher.master.agent.writer import ReportGenerator -from gpt_researcher.master.agent.context_manager import ContextManager -from gpt_researcher.master.actions import get_retrievers, choose_agent -from gpt_researcher.vector_store import VectorStoreWrapper +from ...config import Config +from ...memory import Memory +from ...utils.enum import ReportSource, ReportType, Tone +from ...llm_provider import GenericLLMProvider +from ..agent.researcher import ResearchConductor +from ..agent.scraper import ReportScraper +from ..agent.writer import ReportGenerator +from ..agent.context_manager import ContextManager +from ..actions import get_retrievers, choose_agent +from ...vector_store import VectorStoreWrapper class GPTResearcher: diff --git a/gpt_researcher/master/agent/researcher.py b/gpt_researcher/master/agent/researcher.py index bcec513be..451655fb3 100644 --- a/gpt_researcher/master/agent/researcher.py +++ b/gpt_researcher/master/agent/researcher.py @@ -2,10 +2,10 @@ import random from typing import Dict, Optional -from gpt_researcher.master.actions.utils import stream_output -from gpt_researcher.master.actions import get_sub_queries, scrape_urls -from gpt_researcher.document import DocumentLoader, LangChainDocumentLoader -from gpt_researcher.utils.enum import ReportSource, ReportType, Tone +from ..actions.utils import stream_output +from ..actions import get_sub_queries, scrape_urls +from ...document import DocumentLoader, LangChainDocumentLoader +from ...utils.enum import ReportSource, ReportType, Tone class ResearchConductor: diff --git a/gpt_researcher/master/agent/scraper.py b/gpt_researcher/master/agent/scraper.py index 9faffa083..fb865aae2 100644 --- a/gpt_researcher/master/agent/scraper.py +++ b/gpt_researcher/master/agent/scraper.py @@ -1,6 +1,6 @@ import asyncio from typing import List, Dict -from gpt_researcher.master.actions import scrape_urls +from ..actions import scrape_urls class ReportScraper: diff --git a/gpt_researcher/master/agent/writer.py b/gpt_researcher/master/agent/writer.py index b1facfbd5..a958acf19 100644 --- a/gpt_researcher/master/agent/writer.py +++ b/gpt_researcher/master/agent/writer.py @@ -1,7 +1,7 @@ from typing import Dict, Optional -from gpt_researcher.utils.llm import construct_subtopics -from gpt_researcher.master.actions import ( +from ...utils.llm import construct_subtopics +from ..actions import ( stream_output, generate_report, generate_draft_section_titles, diff --git a/gpt_researcher/master/prompts.py b/gpt_researcher/master/prompts.py index f487628bc..788015273 100644 --- a/gpt_researcher/master/prompts.py +++ b/gpt_researcher/master/prompts.py @@ -1,7 +1,7 @@ import warnings from datetime import date, datetime, timezone -from gpt_researcher.utils.enum import ReportSource, ReportType, Tone +from ..utils.enum import ReportSource, ReportType, Tone def generate_search_queries_prompt(