Skip to content

Commit

Permalink
refactored orchestrator to master
Browse files Browse the repository at this point in the history
  • Loading branch information
assafelovic committed Oct 11, 2024
1 parent 0879e16 commit a1e8b8a
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion backend/report_type/basic_report/basic_report.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fastapi import WebSocket

from gpt_researcher.orchestrator.agent import GPTResearcher
from gpt_researcher.master.agent import GPTResearcher
from gpt_researcher.utils.enum import Tone


Expand Down
6 changes: 3 additions & 3 deletions backend/report_type/detailed_report/detailed_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
from typing import List, Dict, Set, Optional
from fastapi import WebSocket

from gpt_researcher.orchestrator.actions import (
from gpt_researcher.master.actions import (
add_references,
extract_headers,
extract_sections,
table_of_contents,
)
from gpt_researcher.orchestrator.agent import GPTResearcher
from gpt_researcher.master.agent import GPTResearcher
from gpt_researcher.utils.enum import Tone
from gpt_researcher.utils.validators import Subtopics
from gpt_researcher.orchestrator.actions.markdown_processing import extract_headers
from gpt_researcher.master.actions.markdown_processing import extract_headers


class DetailedReport:
Expand Down
2 changes: 1 addition & 1 deletion backend/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from backend.server.websocket_manager import WebSocketManager
from multi_agents.main import run_research_task
from gpt_researcher.document.document import DocumentLoader
from gpt_researcher.orchestrator.actions import stream_output
from gpt_researcher.master.actions import stream_output
from backend.server.server_utils import (
sanitize_filename, handle_start_command, handle_human_feedback,
generate_report_files, send_file_paths, get_config_dict,
Expand Down
2 changes: 1 addition & 1 deletion backend/server/websocket_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from backend.report_type import BasicReport, DetailedReport
from gpt_researcher.utils.enum import ReportType, Tone
from multi_agents.main import run_research_task
from gpt_researcher.orchestrator.actions import stream_output # Import stream_output
from gpt_researcher.master.actions import stream_output # Import stream_output


class WebSocketManager:
Expand Down
2 changes: 1 addition & 1 deletion gpt_researcher/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .orchestrator import GPTResearcher
from .master import GPTResearcher
from .config import Config

__all__ = ['GPTResearcher', 'Config']
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.orchestrator.prompts import auto_agent_instructions, generate_search_queries_prompt
from gpt_researcher.master.prompts import auto_agent_instructions, generate_search_queries_prompt


async def choose_agent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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.orchestrator.prompts import (
from gpt_researcher.master.prompts import (
generate_report_introduction,
generate_draft_titles_prompt,
generate_report_conclusion,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.orchestrator.actions.utils import stream_output
from gpt_researcher.master.actions.utils import stream_output


class ContextManager:
Expand Down Expand Up @@ -215,7 +215,7 @@ async def get_similar_content_by_query(self, query, pages):
)

async def __get_sub_queries(self, query):
from gpt_researcher.orchestrator.actions import get_sub_queries
from gpt_researcher.master.actions import get_sub_queries
return await get_sub_queries(
query=query,
agent_role_prompt=self.researcher.role,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
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.orchestrator.agent.researcher import ResearchConductor
from gpt_researcher.orchestrator.agent.scraper import ReportScraper
from gpt_researcher.orchestrator.agent.writer import ReportGenerator
from gpt_researcher.orchestrator.agent.context_manager import ContextManager
from gpt_researcher.orchestrator.actions import get_retrievers, choose_agent
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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import random
from typing import Dict, Optional

from gpt_researcher.orchestrator.actions.utils import stream_output
from gpt_researcher.orchestrator.actions import get_sub_queries, scrape_urls
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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
from typing import List, Dict
from gpt_researcher.orchestrator.actions import scrape_urls
from gpt_researcher.master.actions import scrape_urls


class ReportScraper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Dict, Optional

from gpt_researcher.utils.llm import construct_subtopics
from gpt_researcher.orchestrator.actions import (
from gpt_researcher.master.actions import (
stream_output,
generate_report,
generate_draft_section_titles,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gpt_researcher/utils/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from langchain.output_parsers import PydanticOutputParser
from langchain.prompts import PromptTemplate

from gpt_researcher.orchestrator.prompts import generate_subtopics_prompt
from gpt_researcher.master.prompts import generate_subtopics_prompt
from .costs import estimate_llm_cost
from .validators import Subtopics

Expand Down
2 changes: 1 addition & 1 deletion multi_agents/agents/utils/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from langchain_community.adapters.openai import convert_openai_messages

from gpt_researcher.config.config import Config
from gpt_researcher.orchestrator.actions.query_processing import handle_json_error
from gpt_researcher.master.actions.query_processing import handle_json_error
from gpt_researcher.utils.llm import create_chat_completion

from loguru import logger
Expand Down
2 changes: 1 addition & 1 deletion tests/documents-report-source.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import asyncio
import pytest
# Ensure this path is correct
from gpt_researcher.orchestrator.agent import GPTResearcher
from gpt_researcher.master.agent import GPTResearcher
from dotenv import load_dotenv
load_dotenv()

Expand Down

0 comments on commit a1e8b8a

Please sign in to comment.