Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ ELASTICSEARCH_URL=http://index:9200

# Chatbot
GOOGLE_APPLICATION_CREDENTIALS=
BILLING_PROJECT_ID=
QUERY_PROJECT_ID=
MODEL_URI=
EMBEDDING_MODEL=
PGVECTOR_COLLECTION=
LANGCHAIN_TRACING_V2=
LANGCHAIN_API_KEY=
LANGSMITH_TRACING=
LANGSMITH_API_KEY=
LANGSMITH_PROJECT=

# Local DB populating
METABASE_USER=
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ ENV POETRY_VIRTUALENVS_PATH=$POETRY_VIRTUALENVS_PATH
# Copy and install project
WORKDIR /app
COPY . .
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)
RUN poetry install --only main && rm nginx.conf

# Generate static and set permissions
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
git clone https://github.com/basedosdados/backend.git
```

- Baixar submodulos
```
git submodule update --recursive --init
```

- Abrí-lo no seu editor de texto

- No seu ambiente de desenvolvimento, instalar [poetry](https://python-poetry.org/) para gerenciamento de dependências
Expand Down
9 changes: 4 additions & 5 deletions backend/apps/chatbot/agent/react_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
from langchain_core.tools import BaseTool, BaseToolkit
from langgraph.checkpoint.postgres import PostgresSaver
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
from langgraph.graph import StateGraph
from langgraph.graph.graph import CompiledGraph
from langgraph.graph.message import add_messages
from langgraph.graph.state import CompiledStateGraph, StateGraph
from langgraph.managed import IsLastStep, RemainingSteps
from langgraph.prebuilt import ToolNode
from loguru import logger
Expand Down Expand Up @@ -131,7 +130,7 @@ async def _acall_model(

return {"messages": [response]}

def _compile(self, start_hook: Callable[[State], dict]) -> CompiledGraph:
def _compile(self, start_hook: Callable[[State], dict]) -> CompiledStateGraph:
"""Compiles the state graph into a LangChain Runnable.

Args:
Expand Down Expand Up @@ -268,7 +267,7 @@ def clear_thread(self, thread_id: str):
thread_id (str): The thread unique identifier.
"""
if self.checkpointer is not None:
delete_checkpoints(self.checkpointer, thread_id)
self.checkpointer.delete_thread(thread_id)

async def aclear_thread(self, thread_id: str):
"""Asynchronously deletes all checkpoints for a given thread.
Expand All @@ -277,7 +276,7 @@ async def aclear_thread(self, thread_id: str):
thread_id (str): The thread unique identifier.
"""
if self.checkpointer is not None:
await async_delete_checkpoints(self.checkpointer, thread_id)
await self.checkpointer.adelete_thread(thread_id)


def _should_continue(state: State) -> Literal["tools", "__end__"]:
Expand Down
7 changes: 0 additions & 7 deletions backend/apps/chatbot/apps.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# -*- coding: utf-8 -*-
from django.apps import AppConfig
from loguru import logger


class ChatbotConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "backend.apps.chatbot"
verbose_name = "Chatbot"

def ready(self):
# Enable logs from the chatbot package
import chatbot

logger.enable(chatbot.__name__)
4 changes: 0 additions & 4 deletions backend/apps/chatbot/context_provider/__init__.py

This file was deleted.

99 changes: 0 additions & 99 deletions backend/apps/chatbot/context_provider/metadata_formatter.py

This file was deleted.

199 changes: 0 additions & 199 deletions backend/apps/chatbot/context_provider/postgres_context_provider.py

This file was deleted.

Empty file.
Empty file.
Loading
Loading