Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor frontend fixes and docker compose file for elestio #50

Merged
merged 60 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d681728
change buttons to shadcn
ervinpiol Jul 31, 2024
69b4e39
Merge branch 'main' into web-dev
ervinpiol Aug 1, 2024
07f7d21
change tailwind.config
ervinpiol Aug 1, 2024
28775b7
fix tailwind
ervinpiol Aug 1, 2024
55151dd
quick fix
ervinpiol Aug 1, 2024
02bc569
add prettier
ervinpiol Aug 1, 2024
d2284c5
change components to shadcn
ervinpiol Aug 1, 2024
e97ebde
fix chatsidebar button
ervinpiol Aug 1, 2024
cc59c39
change select color
ervinpiol Aug 1, 2024
87a7004
modified the docker-compose for elestio
SchadenKai Aug 5, 2024
0b04368
start redesign chat
ervinpiol Aug 6, 2024
0f25d80
first mobile modification
ervinpiol Aug 9, 2024
f8bdc27
fix prettier
ervinpiol Aug 9, 2024
039f787
fix prettier part 2
ervinpiol Aug 9, 2024
75ed581
update chat
ervinpiol Aug 9, 2024
206d10b
test right sidebar
ervinpiol Aug 9, 2024
3323c5a
side bar change
ervinpiol Aug 9, 2024
3464742
side bar animation
ervinpiol Aug 9, 2024
059b06a
change separator geight
ervinpiol Aug 9, 2024
054d39a
refactor: Change into Schadcn/ui. Implemented redesign in Chat and Se…
SchadenKai Aug 9, 2024
852e783
initial redesign
ervinpiol Aug 13, 2024
fc508e2
second redesign
ervinpiol Aug 13, 2024
96e4d09
fix sidebar
ervinpiol Aug 13, 2024
e69b829
fxi
ervinpiol Aug 14, 2024
a90b523
fix
ervinpiol Aug 14, 2024
51e2526
fixx
ervinpiol Aug 14, 2024
6a947f7
Fix prettier formatting issue in ChatSidebar.tsx
ervinpiol Aug 14, 2024
d6e64f3
fix prettier
ervinpiol Aug 14, 2024
648edb5
Merge pull request #40 from enMedD/web-dev
SchadenKai Aug 14, 2024
4389675
fix font
ervinpiol Aug 14, 2024
aa0b25e
clean comments
ervinpiol Aug 14, 2024
2efba35
Merge branch 'dev-elestio-env' into web-dev
SchadenKai Aug 14, 2024
4e22063
use prettier
ervinpiol Aug 14, 2024
59850da
Merge branch 'web-dev' of https://github.com/enMedD/ConversationalHea…
ervinpiol Aug 14, 2024
3dce9fd
fix
ervinpiol Aug 14, 2024
2ba9832
fix some word break
ervinpiol Aug 15, 2024
b64105d
change tooltip
ervinpiol Aug 15, 2024
6c5cfe1
Merge pull request #45 from enMedD/web-dev
SchadenKai Aug 15, 2024
a1812e1
fix chat input bar
ervinpiol Aug 15, 2024
da80d63
made some minor fixes in the docker-compose and the login
SchadenKai Aug 15, 2024
0676d87
change icons
ervinpiol Aug 15, 2024
fd49620
move ChatProvider
ervinpiol Aug 15, 2024
f6e31fd
change layout.tsx
ervinpiol Aug 15, 2024
258abda
Merge pull request #46 from enMedD/web-dev
SchadenKai Aug 15, 2024
6116079
Workspaces_tables/relationships
Amboyandrey Aug 15, 2024
8a58741
fix trucate
ervinpiol Aug 15, 2024
2d74364
fix width of chat
ervinpiol Aug 15, 2024
8955cb7
change search filter
ervinpiol Aug 16, 2024
f94ef3b
add updated_at
ervinpiol Aug 16, 2024
bf44c82
add starter_message
ervinpiol Aug 16, 2024
a4ddeb0
renamed default assistant and created starter messages
SchadenKai Aug 18, 2024
61c0bf1
created new docker-compose file for elestio
SchadenKai Aug 18, 2024
30e57cc
Merge branch 'dev-env' of https://github.com/enMedD/ConversationalHea…
SchadenKai Aug 18, 2024
65489c1
Merge pull request #49 from enMedD/rebranding-1
SchadenKai Aug 18, 2024
fbc81a6
Merge pull request #47 from enMedD/web-dev
SchadenKai Aug 18, 2024
a6fd54c
Merge pull request #48 from enMedD/migration_changes
SchadenKai Aug 18, 2024
f39c5bd
Merge branch 'dev-env' of https://github.com/enMedD/ConversationalHea…
SchadenKai Aug 18, 2024
4ce94ab
Merge branch 'dev-env' of https://github.com/enMedD/ConversationalHea…
SchadenKai Aug 18, 2024
7f7b04b
implement some minor changes in the chat page
SchadenKai Aug 18, 2024
3a7de9a
move the docker compose file into root for elestio
SchadenKai Aug 18, 2024
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
330 changes: 330 additions & 0 deletions backend/alembic/versions/2c084e6c102a_fix_migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
"""fix migration
Revision ID: 2c084e6c102a
Revises: 3a7802814195
Create Date: 2024-08-15 17:31:25.978543
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
import fastapi_users_db_sqlalchemy

# revision identifiers, used by Alembic.
revision = "2c084e6c102a"
down_revision = "3a7802814195"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"instance",
sa.Column("instance_id", sa.Integer(), nullable=False),
sa.Column("instance_name", sa.Text(), nullable=False),
sa.Column(
"subscription_plan",
sa.Enum(
"ENTERPRISE",
"PARTNER",
name="instancesubscriptionplan",
native_enum=False,
),
nullable=False,
),
sa.Column(
"owner_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.ForeignKeyConstraint(
["owner_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("instance_id"),
)
op.create_table(
"workspace",
sa.Column("workspace_id", sa.Integer(), nullable=False),
sa.Column("instance_id", sa.Integer(), nullable=True),
sa.Column("Workspace_name", sa.Text(), nullable=False),
sa.Column("custom_logo", sa.Text(), nullable=False),
sa.Column("custom_header_logo", sa.Text(), nullable=False),
sa.ForeignKeyConstraint(
["instance_id"],
["instance.instance_id"],
),
sa.PrimaryKeyConstraint("workspace_id"),
)
op.create_table(
"workspace__users",
sa.Column("workspace_id", sa.Integer(), nullable=False),
sa.Column(
"user_id",
fastapi_users_db_sqlalchemy.generics.GUID(),
nullable=False,
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.ForeignKeyConstraint(
["workspace_id"],
["workspace.workspace_id"],
),
sa.PrimaryKeyConstraint("workspace_id", "user_id"),
)
op.create_table(
"workspace_settings",
sa.Column("workspace_id", sa.Integer(), nullable=False),
sa.Column("chat_page_enabled", sa.Boolean(), nullable=False),
sa.Column("search_page_enabled", sa.Boolean(), nullable=False),
sa.Column(
"default_page",
sa.Enum("CHAT", "SEARCH", name="defaultpage", native_enum=False),
nullable=False,
),
sa.Column("maximum_chat_retention_days", sa.Integer(), nullable=False),
sa.Column(
"subscription_plan",
sa.Enum(
"BASIC",
"PROFESSIONAL",
"ORGANIZATION",
name="workspacesubscriptionplan",
native_enum=False,
),
nullable=False,
),
sa.Column("number_of_users", sa.Integer(), nullable=False),
sa.Column("storage_limit", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["workspace_id"],
["workspace.workspace_id"],
),
sa.PrimaryKeyConstraint("workspace_id"),
)
op.create_table(
"workspace__user_group",
sa.Column("workspace_id", sa.Integer(), nullable=False),
sa.Column("user_group_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["user_group_id"],
["user_group.id"],
),
sa.ForeignKeyConstraint(
["workspace_id"],
["workspace.workspace_id"],
),
sa.PrimaryKeyConstraint("workspace_id", "user_group_id"),
)
op.create_table(
"celery_taskmeta",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("task_id", sa.String(length=155), nullable=True),
sa.Column("status", sa.String(length=50), nullable=True),
sa.Column("result", sa.PickleType(), nullable=True),
sa.Column("date_done", sa.DateTime(), nullable=True),
sa.Column("traceback", sa.Text(), nullable=True),
sa.Column("name", sa.String(length=155), nullable=True),
sa.Column("args", sa.LargeBinary(), nullable=True),
sa.Column("kwargs", sa.LargeBinary(), nullable=True),
sa.Column("worker", sa.String(length=155), nullable=True),
sa.Column("retries", sa.Integer(), nullable=True),
sa.Column("queue", sa.String(length=155), nullable=True),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("task_id"),
sqlite_autoincrement=True,
)
op.create_table(
"celery_tasksetmeta",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("taskset_id", sa.String(length=155), nullable=True),
sa.Column("result", sa.PickleType(), nullable=True),
sa.Column("date_done", sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("taskset_id"),
sqlite_autoincrement=True,
)
op.drop_table("slack_bot_config")
op.create_foreign_key(None, "api_key", "user", ["owner_id"], ["id"])
op.create_foreign_key(None, "api_key", "user", ["user_id"], ["id"])
op.alter_column(
"chat_folder",
"display_priority",
existing_type=sa.INTEGER(),
nullable=True,
)
#op.drop_constraint("chat_message_id_key", "chat_message", type_="unique")
op.alter_column(
"credential",
"credential_json",
existing_type=postgresql.BYTEA(),
nullable=False,
)
op.drop_index(
"ix_document_by_connector_credential_pair_pkey__connecto_27dc",
table_name="document_by_connector_credential_pair",
)
op.add_column(
"email_to_external_user_cache",
sa.Column(
"source_type",
sa.Enum(
"INGESTION_API",
"WEB",
"GOOGLE_DRIVE",
"GMAIL",
"GITHUB",
"GITLAB",
"CONFLUENCE",
"JIRA",
"PRODUCTBOARD",
"FILE",
"NOTION",
"HUBSPOT",
"GOOGLE_SITES",
"ZENDESK",
"DROPBOX",
"SHAREPOINT",
"TEAMS",
"SALESFORCE",
"S3",
"R2",
"GOOGLE_CLOUD_STORAGE",
"OCI_STORAGE",
name="documentsource",
native_enum=False,
),
nullable=False,
),
)
op.alter_column(
"embedding_model", "status", existing_type=sa.VARCHAR(), nullable=False
)
op.create_index(
"ix_embedding_model_future_unique",
"embedding_model",
["status"],
unique=True,
postgresql_where=sa.text("status = 'FUTURE'"),
)
op.create_index(
"ix_embedding_model_present_unique",
"embedding_model",
["status"],
unique=True,
postgresql_where=sa.text("status = 'PRESENT'"),
)
op.alter_column(
"llm_provider", "provider", existing_type=sa.VARCHAR(), nullable=False
)
op.alter_column(
"saml",
"expires_at",
existing_type=postgresql.TIMESTAMP(timezone=True),
nullable=False,
)
op.alter_column(
"tool_call",
"tool_result",
existing_type=postgresql.JSONB(astext_type=sa.Text()),
nullable=True,
)
op.add_column(
"user_group", sa.Column("workspace_id", sa.Integer(), nullable=False)
)
op.create_foreign_key(
None, "user_group", "workspace", ["workspace_id"], ["workspace_id"]
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "user_group", type_="foreignkey")
op.drop_column("user_group", "workspace_id")
op.alter_column(
"tool_call",
"tool_result",
existing_type=postgresql.JSONB(astext_type=sa.Text()),
nullable=False,
)
op.alter_column(
"saml",
"expires_at",
existing_type=postgresql.TIMESTAMP(timezone=True),
nullable=True,
)
op.alter_column(
"llm_provider", "provider", existing_type=sa.VARCHAR(), nullable=True
)
op.drop_index(
"ix_embedding_model_present_unique",
table_name="embedding_model",
postgresql_where=sa.text("status = 'PRESENT'"),
)
op.drop_index(
"ix_embedding_model_future_unique",
table_name="embedding_model",
postgresql_where=sa.text("status = 'FUTURE'"),
)
op.alter_column(
"embedding_model", "status", existing_type=sa.VARCHAR(), nullable=True
)
op.drop_column("email_to_external_user_cache", "source_type")
op.create_index(
"ix_document_by_connector_credential_pair_pkey__connecto_27dc",
"document_by_connector_credential_pair",
["connector_id", "credential_id"],
unique=False,
)
op.alter_column(
"credential",
"credential_json",
existing_type=postgresql.BYTEA(),
nullable=True,
)
op.create_unique_constraint("chat_message_id_key", "chat_message", ["id"])
op.alter_column(
"chat_folder",
"display_priority",
existing_type=sa.INTEGER(),
nullable=False,
)
op.drop_constraint(None, "api_key", type_="foreignkey")
op.drop_constraint(None, "api_key", type_="foreignkey")
op.create_table(
"slack_bot_config",
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column(
"persona_id", sa.INTEGER(), autoincrement=False, nullable=True
),
sa.Column(
"channel_config",
postgresql.JSONB(astext_type=sa.Text()),
autoincrement=False,
nullable=False,
),
sa.Column(
"response_type",
sa.VARCHAR(length=9),
autoincrement=False,
nullable=False,
),
sa.ForeignKeyConstraint(
["persona_id"],
["persona.id"],
name="slack_bot_config_persona_id_fkey",
),
sa.PrimaryKeyConstraint("id", name="slack_bot_config_pkey"),
)
op.drop_table("celery_tasksetmeta")
op.drop_table("celery_taskmeta")
op.drop_table("workspace__user_group")
op.drop_table("workspace_settings")
op.drop_table("workspace__users")
op.drop_table("workspace")
op.drop_table("instance")
# ### end Alembic commands ###
27 changes: 24 additions & 3 deletions backend/danswer/chat/personas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ personas:
# this is for DanswerBot to use when tagged in a non-configured channel
# Careful setting specific IDs, this won't autoincrement the next ID value for postgres
- id: 0
name: "enMedD CHP"
name: "enMedD AI"
description: >
Assistant with access to documents from your Connected Sources.
# Default Prompt objects attached to the persona, see prompts.yaml
Expand Down Expand Up @@ -37,7 +37,29 @@ personas:
# - "Engineer Onboarding"
# - "Benefits"
document_sets: []

starter_messages:
[
{
"name": "Business Advice",
"description": "Ask me anything about starting, running, or growing a business.",
"message": "What business advice do you need?",
},
{
"name": "Marketing Strategy",
"description": "Let's discuss your target audience, messaging, and channels.",
"message": "How can I improve my marketing strategy?",
},
{
"name": "Financial Planning",
"description": "Ask me about budgeting, cash flow, or investment.",
"message": "Do you have any questions about business finance?",
},
{
"name": "Employee Management",
"description": "Let's discuss hiring, onboarding, performance reviews, or team building.",
"message": "How can I improve my employee management skills?",
},
]

- id: 1
name: "GPT"
Expand All @@ -51,7 +73,6 @@ personas:
recency_bias: "auto"
document_sets: []


- id: 2
name: "Paraphrase"
description: >
Expand Down
16 changes: 16 additions & 0 deletions backend/danswer/db/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,19 @@ class IndexModelStatus(str, PyEnum):
class ChatSessionSharedStatus(str, PyEnum):
PUBLIC = "public"
PRIVATE = "private"


class DefaultPage(str, PyEnum):
CHAT = "chat"
SEARCH = "search"


class WorkspaceSubscriptionPlan(str, PyEnum):
BASIC = "basic"
PROFESSIONAL = "professional"
ORGANIZATION = "organization"


class InstanceSubscriptionPlan(str, PyEnum):
ENTERPRISE = "enterprise"
PARTNER = "partner"
Loading
Loading