diff --git a/surfsense_backend/app/agents/podcaster/nodes.py b/surfsense_backend/app/agents/podcaster/nodes.py index d1dea9b..63373b5 100644 --- a/surfsense_backend/app/agents/podcaster/nodes.py +++ b/surfsense_backend/app/agents/podcaster/nodes.py @@ -14,7 +14,7 @@ from .configuration import Configuration from .state import PodcastTranscriptEntry, State, PodcastTranscripts from .prompts import get_podcast_generation_prompt from app.config import config as app_config -from app.utils.llm_service import get_user_long_context_llm +from app.services.llm_service import get_user_long_context_llm async def create_podcast_transcript(state: State, config: RunnableConfig) -> Dict[str, Any]: diff --git a/surfsense_backend/app/agents/researcher/nodes.py b/surfsense_backend/app/agents/researcher/nodes.py index c282327..01842a6 100644 --- a/surfsense_backend/app/agents/researcher/nodes.py +++ b/surfsense_backend/app/agents/researcher/nodes.py @@ -2,7 +2,7 @@ import asyncio import json from typing import Any, Dict, List -from app.utils.connector_service import ConnectorService +from app.services.connector_service import ConnectorService from langchain_core.messages import HumanMessage, SystemMessage from langchain_core.runnables import RunnableConfig @@ -16,7 +16,7 @@ from .sub_section_writer.configuration import SubSectionType from .qna_agent.graph import graph as qna_agent_graph from .utils import AnswerOutline, get_connector_emoji, get_connector_friendly_name -from app.utils.query_service import QueryService +from app.services.query_service import QueryService from langgraph.types import StreamWriter @@ -262,7 +262,7 @@ async def write_answer_outline(state: State, config: RunnableConfig, writer: Str Returns: Dict containing the answer outline in the "answer_outline" key for state update. """ - from app.utils.llm_service import get_user_strategic_llm + from app.services.llm_service import get_user_strategic_llm from app.db import get_async_session streaming_service = state.streaming_service diff --git a/surfsense_backend/app/agents/researcher/qna_agent/nodes.py b/surfsense_backend/app/agents/researcher/qna_agent/nodes.py index 659f2f3..910f55b 100644 --- a/surfsense_backend/app/agents/researcher/qna_agent/nodes.py +++ b/surfsense_backend/app/agents/researcher/qna_agent/nodes.py @@ -1,4 +1,4 @@ -from app.utils.reranker_service import RerankerService +from app.services.reranker_service import RerankerService from .configuration import Configuration from langchain_core.runnables import RunnableConfig from .state import State @@ -85,7 +85,7 @@ async def answer_question(state: State, config: RunnableConfig) -> Dict[str, Any Returns: Dict containing the final answer in the "final_answer" key. """ - from app.utils.llm_service import get_user_fast_llm + from app.services.llm_service import get_user_fast_llm # Get configuration and relevant documents from configuration configuration = Configuration.from_runnable_config(config) diff --git a/surfsense_backend/app/agents/researcher/state.py b/surfsense_backend/app/agents/researcher/state.py index edc73f1..871314a 100644 --- a/surfsense_backend/app/agents/researcher/state.py +++ b/surfsense_backend/app/agents/researcher/state.py @@ -5,7 +5,7 @@ from __future__ import annotations from dataclasses import dataclass, field from typing import List, Optional, Any from sqlalchemy.ext.asyncio import AsyncSession -from app.utils.streaming_service import StreamingService +from app.services.streaming_service import StreamingService @dataclass class State: diff --git a/surfsense_backend/app/agents/researcher/sub_section_writer/nodes.py b/surfsense_backend/app/agents/researcher/sub_section_writer/nodes.py index bd0c552..75d3f35 100644 --- a/surfsense_backend/app/agents/researcher/sub_section_writer/nodes.py +++ b/surfsense_backend/app/agents/researcher/sub_section_writer/nodes.py @@ -2,7 +2,7 @@ from .configuration import Configuration from langchain_core.runnables import RunnableConfig from .state import State from typing import Any, Dict -from app.utils.reranker_service import RerankerService +from app.services.reranker_service import RerankerService from .prompts import get_citation_system_prompt, get_no_documents_system_prompt from langchain_core.messages import HumanMessage, SystemMessage from .configuration import SubSectionType @@ -91,7 +91,7 @@ async def write_sub_section(state: State, config: RunnableConfig) -> Dict[str, A Returns: Dict containing the final answer in the "final_answer" key. """ - from app.utils.llm_service import get_user_fast_llm + from app.services.llm_service import get_user_fast_llm # Get configuration and relevant documents from configuration configuration = Configuration.from_runnable_config(config) diff --git a/surfsense_backend/app/services/__init__.py b/surfsense_backend/app/services/__init__.py new file mode 100644 index 0000000..9983534 --- /dev/null +++ b/surfsense_backend/app/services/__init__.py @@ -0,0 +1 @@ +# Services package \ No newline at end of file diff --git a/surfsense_backend/app/utils/connector_service.py b/surfsense_backend/app/services/connector_service.py similarity index 100% rename from surfsense_backend/app/utils/connector_service.py rename to surfsense_backend/app/services/connector_service.py diff --git a/surfsense_backend/app/utils/llm_service.py b/surfsense_backend/app/services/llm_service.py similarity index 100% rename from surfsense_backend/app/utils/llm_service.py rename to surfsense_backend/app/services/llm_service.py diff --git a/surfsense_backend/app/utils/query_service.py b/surfsense_backend/app/services/query_service.py similarity index 99% rename from surfsense_backend/app/utils/query_service.py rename to surfsense_backend/app/services/query_service.py index 61ba5e4..c26cd0a 100644 --- a/surfsense_backend/app/utils/query_service.py +++ b/surfsense_backend/app/services/query_service.py @@ -1,7 +1,7 @@ import datetime from langchain.schema import HumanMessage, SystemMessage, AIMessage from app.config import config -from app.utils.llm_service import get_user_strategic_llm +from app.services.llm_service import get_user_strategic_llm from sqlalchemy.ext.asyncio import AsyncSession from typing import Any, List, Optional diff --git a/surfsense_backend/app/utils/reranker_service.py b/surfsense_backend/app/services/reranker_service.py similarity index 100% rename from surfsense_backend/app/utils/reranker_service.py rename to surfsense_backend/app/services/reranker_service.py diff --git a/surfsense_backend/app/utils/streaming_service.py b/surfsense_backend/app/services/streaming_service.py similarity index 100% rename from surfsense_backend/app/utils/streaming_service.py rename to surfsense_backend/app/services/streaming_service.py diff --git a/surfsense_backend/app/tasks/background_tasks.py b/surfsense_backend/app/tasks/background_tasks.py index 5c3ffe3..53347b2 100644 --- a/surfsense_backend/app/tasks/background_tasks.py +++ b/surfsense_backend/app/tasks/background_tasks.py @@ -7,7 +7,7 @@ from app.schemas import ExtensionDocumentContent from app.config import config from app.prompts import SUMMARY_PROMPT_TEMPLATE from app.utils.document_converters import convert_document_to_markdown, generate_content_hash -from app.utils.llm_service import get_user_long_context_llm +from app.services.llm_service import get_user_long_context_llm from langchain_core.documents import Document as LangChainDocument from langchain_community.document_loaders import FireCrawlLoader, AsyncChromiumLoader from langchain_community.document_transformers import MarkdownifyTransformer diff --git a/surfsense_backend/app/tasks/connectors_indexing_tasks.py b/surfsense_backend/app/tasks/connectors_indexing_tasks.py index eaa60a2..c25a7f4 100644 --- a/surfsense_backend/app/tasks/connectors_indexing_tasks.py +++ b/surfsense_backend/app/tasks/connectors_indexing_tasks.py @@ -6,7 +6,7 @@ from datetime import datetime, timedelta, timezone from app.db import Document, DocumentType, Chunk, SearchSourceConnector, SearchSourceConnectorType, SearchSpace from app.config import config from app.prompts import SUMMARY_PROMPT_TEMPLATE -from app.utils.llm_service import get_user_long_context_llm +from app.services.llm_service import get_user_long_context_llm from app.connectors.slack_history import SlackHistory from app.connectors.notion_history import NotionHistoryConnector from app.connectors.github_connector import GitHubConnector diff --git a/surfsense_backend/app/tasks/stream_connector_search_results.py b/surfsense_backend/app/tasks/stream_connector_search_results.py index 441ce1e..145214c 100644 --- a/surfsense_backend/app/tasks/stream_connector_search_results.py +++ b/surfsense_backend/app/tasks/stream_connector_search_results.py @@ -3,7 +3,7 @@ from uuid import UUID from app.agents.researcher.graph import graph as researcher_graph from app.agents.researcher.state import State -from app.utils.streaming_service import StreamingService +from app.services.streaming_service import StreamingService from sqlalchemy.ext.asyncio import AsyncSession from app.agents.researcher.configuration import SearchMode