Skip to content

Commit

Permalink
Merge pull request #30 from enMedD/rebranding
Browse files Browse the repository at this point in the history
Removed slackbot in source code and database schema
  • Loading branch information
SchadenKai authored Jul 16, 2024
2 parents 0762489 + 014e74f commit 393d91e
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 491 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
- name: Push Docker image to ECR
run: |
docker tag ${{ env.ECR_MODEL_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_MODEL_REPOSITORY }}:$IMAGE_TAG
docker tag ${{ env.ECR_MODEL_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_MODEL_REPOSITORY }}:latest
docker push ${{ env.ECR_MODEL_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_MODEL_REPOSITORY }}:$IMAGE_TAG
docker push ${{ env.ECR_MODEL_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_MODEL_REPOSITORY }}:latest
docker tag ${{ env.ECR_API_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_API_REPOSITORY }}:$IMAGE_TAG
docker tag ${{ env.ECR_API_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_API_REPOSITORY }}:latest
docker push ${{ env.ECR_API_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_API_REPOSITORY }}:$IMAGE_TAG
docker push ${{ env.ECR_API_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_API_REPOSITORY }}:latest
docker tag ${{ env.ECR_WEB_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_WEB_REPOSITORY }}:$IMAGE_TAG
docker tag ${{ env.ECR_WEB_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_WEB_REPOSITORY }}:latest
docker push ${{ env.ECR_WEB_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_WEB_REPOSITORY }}:$IMAGE_TAG
docker push ${{ env.ECR_WEB_REPOSITORY }}:$IMAGE_TAG ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_WEB_REPOSITORY }}:latest
15 changes: 0 additions & 15 deletions .vscode/launch.template.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,6 @@
"args": [
"--no-indexing"
]
},
// For the listner to access the Slack API,
// DANSWER_BOT_SLACK_APP_TOKEN & DANSWER_BOT_SLACK_BOT_TOKEN need to be set in .env file located in the root of the project
{
"name": "Slack Bot",
"type": "python",
"request": "launch",
"program": "danswer/danswerbot/slack/listener.py",
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/.env",
"env": {
"LOG_LEVEL": "DEBUG",
"PYTHONUNBUFFERED": "1",
"PYTHONPATH": "."
}
}
]
}
38 changes: 0 additions & 38 deletions backend/alembic/versions/7da543f5672f_add_slackbotconfig_table.py

This file was deleted.

This file was deleted.

4 changes: 1 addition & 3 deletions backend/danswer/configs/app_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@
# Enterprise Edition Configs
#####
# NOTE: this should only be enabled if you have purchased an enterprise license.
# if you're interested in an enterprise license, please reach out to us at
# founders@danswer.ai OR message Chris Weaver or Yuhong Sun in the Danswer
# Slack community (https://join.slack.com/t/danswer/shared_invite/zt-1w76msxmd-HJHLe3KNFIAIzk_0dSOKaQ)

ENTERPRISE_EDITION_ENABLED = (
os.environ.get("ENABLE_PAID_ENTERPRISE_EDITION_FEATURES", "").lower() == "true"
)
82 changes: 0 additions & 82 deletions backend/danswer/configs/danswerbot_configs.py

This file was deleted.

1 change: 0 additions & 1 deletion backend/danswer/db/constants.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
SLACK_BOT_PERSONA_PREFIX = "__slack_bot_persona__"
39 changes: 0 additions & 39 deletions backend/danswer/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,45 +1069,6 @@ class Persona(Base):
Literal["well_answered_postfilter"] | Literal["questionmark_prefilter"]
)


class ChannelConfig(TypedDict):
"""NOTE: is a `TypedDict` so it can be used as a type hint for a JSONB column
in Postgres"""

channel_names: list[str]
respond_tag_only: NotRequired[bool] # defaults to False
respond_to_bots: NotRequired[bool] # defaults to False
respond_team_member_list: NotRequired[list[str]]
respond_slack_group_list: NotRequired[list[str]]
answer_filters: NotRequired[list[AllowedAnswerFilters]]
# If None then no follow up
# If empty list, follow up with no tags
follow_up_tags: NotRequired[list[str]]


class SlackBotResponseType(str, PyEnum):
QUOTES = "quotes"
CITATIONS = "citations"


class SlackBotConfig(Base):
__tablename__ = "slack_bot_config"

id: Mapped[int] = mapped_column(primary_key=True)
persona_id: Mapped[int | None] = mapped_column(
ForeignKey("persona.id"), nullable=True
)
# JSON for flexibility. Contains things like: channel name, team members, etc.
channel_config: Mapped[ChannelConfig] = mapped_column(
postgresql.JSONB(), nullable=False
)
response_type: Mapped[SlackBotResponseType] = mapped_column(
Enum(SlackBotResponseType, native_enum=False), nullable=False
)

persona: Mapped[Persona | None] = relationship("Persona")


class TaskQueueState(Base):
# Currently refers to Celery Tasks
__tablename__ = "task_queue_jobs"
Expand Down
4 changes: 0 additions & 4 deletions backend/danswer/db/persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from sqlalchemy.orm import Session

from danswer.auth.schemas import UserRole
from danswer.db.constants import SLACK_BOT_PERSONA_PREFIX
from danswer.db.document_set import get_document_sets_by_ids
from danswer.db.engine import get_sqlalchemy_engine
from danswer.db.models import DocumentSet
Expand Down Expand Up @@ -173,7 +172,6 @@ def get_personas(
user_id: UUID | None,
db_session: Session,
include_default: bool = True,
include_slack_bot_personas: bool = False,
include_deleted: bool = False,
) -> Sequence[Persona]:
stmt = select(Persona).distinct()
Expand Down Expand Up @@ -201,8 +199,6 @@ def get_personas(

if not include_default:
stmt = stmt.where(Persona.default_persona.is_(False))
if not include_slack_bot_personas:
stmt = stmt.where(not_(Persona.name.startswith(SLACK_BOT_PERSONA_PREFIX)))
if not include_deleted:
stmt = stmt.where(Persona.deleted.is_(False))

Expand Down
Loading

0 comments on commit 393d91e

Please sign in to comment.