Skip to content

Commit a69b070

Browse files
committed
chore: remove submodule chatbot
1 parent 7979bca commit a69b070

File tree

16 files changed

+105
-694
lines changed

16 files changed

+105
-694
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ENV POETRY_VIRTUALENVS_PATH=$POETRY_VIRTUALENVS_PATH
3636
# Copy and install project
3737
WORKDIR /app
3838
COPY . .
39-
RUN test -d ./chatbot || (echo "ERROR: Git submodule 'chatbot' not found. Please run 'git submodule update --init --recursive'. See backend/README.md for more information." && exit 1)
4039
RUN poetry install --only main && rm nginx.conf
4140

4241
# Generate static and set permissions

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
git clone https://github.com/basedosdados/backend.git
1818
```
1919

20-
- Baixar submodulos
21-
```
22-
git submodule update --recursive --init
23-
```
24-
2520
- Abrí-lo no seu editor de texto
2621

2722
- No seu ambiente de desenvolvimento, instalar [poetry](https://python-poetry.org/) para gerenciamento de dependências

backend/apps/chatbot/agent/react_agent.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
from langchain_core.tools import BaseTool, BaseToolkit
99
from langgraph.checkpoint.postgres import PostgresSaver
1010
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
11-
from langgraph.graph import StateGraph
12-
from langgraph.graph.graph import CompiledGraph
1311
from langgraph.graph.message import add_messages
12+
from langgraph.graph.state import CompiledStateGraph, StateGraph
1413
from langgraph.managed import IsLastStep, RemainingSteps
1514
from langgraph.prebuilt import ToolNode
1615
from loguru import logger
1716

18-
from chatbot.agents.utils import async_delete_checkpoints, delete_checkpoints
19-
2017

2118
class State(TypedDict):
2219
messages: Annotated[list[BaseMessage], add_messages]
@@ -132,7 +129,7 @@ async def _acall_model(
132129

133130
return {"messages": [response]}
134131

135-
def _compile(self, start_hook: Callable[[State], dict]) -> CompiledGraph:
132+
def _compile(self, start_hook: Callable[[State], dict]) -> CompiledStateGraph:
136133
"""Compiles the state graph into a LangChain Runnable.
137134
138135
Args:
@@ -269,7 +266,7 @@ def clear_thread(self, thread_id: str):
269266
thread_id (str): The thread unique identifier.
270267
"""
271268
if self.checkpointer is not None:
272-
delete_checkpoints(self.checkpointer, thread_id)
269+
self.checkpointer.delete_thread(thread_id)
273270

274271
async def aclear_thread(self, thread_id: str):
275272
"""Asynchronously deletes all checkpoints for a given thread.
@@ -278,7 +275,7 @@ async def aclear_thread(self, thread_id: str):
278275
thread_id (str): The thread unique identifier.
279276
"""
280277
if self.checkpointer is not None:
281-
await async_delete_checkpoints(self.checkpointer, thread_id)
278+
await self.checkpointer.adelete_thread(thread_id)
282279

283280

284281
def _should_continue(state: State) -> Literal["tools", "__end__"]:

backend/apps/chatbot/apps.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from django.apps import AppConfig
3-
from loguru import logger
43

54

65
class ChatbotConfig(AppConfig):
76
default_auto_field = "django.db.models.BigAutoField"
87
name = "backend.apps.chatbot"
98
verbose_name = "Chatbot"
10-
11-
def ready(self):
12-
# Enable logs from the chatbot package
13-
import chatbot
14-
15-
logger.enable(chatbot.__name__)

backend/apps/chatbot/context_provider/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

backend/apps/chatbot/context_provider/metadata_formatter.py

Lines changed: 0 additions & 99 deletions
This file was deleted.

backend/apps/chatbot/context_provider/postgres_context_provider.py

Lines changed: 0 additions & 199 deletions
This file was deleted.

backend/apps/chatbot/management/__init__.py

Whitespace-only changes.

backend/apps/chatbot/management/commands/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)