-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:cohere-ai/cohere-toolkit into assis…
…tants/deploy
- Loading branch information
Showing
90 changed files
with
18,382 additions
and
3,951 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/interface_tests.yml → .github/workflows/coral_web_tests.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Interface Tests | ||
name: Coral Web Tests | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Slack Bot Tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- src/interfaces/slack_bot/** | ||
pull_request: {} | ||
merge_group: {} | ||
|
||
jobs: | ||
interface_tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: src/interfaces/slack_bot | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: "src/interfaces/slack_bot/.nvmrc" | ||
cache: "pnpm" | ||
cache-dependency-path: "src/interfaces/slack_bot/pnpm-lock.yaml" | ||
- name: Install dependencies with npm | ||
shell: bash | ||
working-directory: src/interfaces/slack_bot | ||
run: pnpm install --frozen-lockfile | ||
- name: Check slack_bot is formatted | ||
run: pnpm run format | ||
- name: Check slack_bot types | ||
run: pnpm run tsc:check | ||
- name: Run slack_bot tests | ||
run: pnpm run test | ||
- name: Check slack_bot can build | ||
run: pnpm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,4 +141,7 @@ secrets.toml | |
.DS_Store | ||
|
||
# Local file storage | ||
/src/backend/data | ||
/src/backend/data | ||
|
||
# Redis volume | ||
/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
"""empty message | ||
Revision ID: 1acff4138b79 | ||
Revises: a48691a80366 | ||
Create Date: 2024-07-09 15:27:44.022554 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "1acff4138b79" | ||
down_revision: Union[str, None] = "a48691a80366" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"agent_tool_metadata", | ||
"user_id", | ||
existing_type=sa.TEXT(), | ||
type_=sa.String(), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"agents", | ||
"user_id", | ||
existing_type=sa.TEXT(), | ||
type_=sa.String(), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"tool_auth", | ||
"user_id", | ||
existing_type=sa.TEXT(), | ||
type_=sa.String(), | ||
existing_nullable=False, | ||
) | ||
|
||
op.drop_constraint( | ||
"documents_conversation_id_fkey", "documents", type_="foreignkey" | ||
) | ||
op.drop_constraint("files_conversation_id_fkey", "files", type_="foreignkey") | ||
op.drop_constraint("messages_conversation_id_fkey", "messages", type_="foreignkey") | ||
op.drop_constraint( | ||
"snapshots_conversation_id_fkey", "snapshots", type_="foreignkey" | ||
) | ||
op.drop_constraint("conversations_pkey", "conversations", type_="primary") | ||
|
||
op.create_unique_constraint( | ||
"conversation_id_user_id", "conversations", ["id", "user_id"] | ||
) | ||
op.create_primary_key("conversations_pkey", "conversations", ["id", "user_id"]) | ||
op.create_index( | ||
"conversation_user_id_index", "conversations", ["id", "user_id"], unique=True | ||
) | ||
|
||
op.create_foreign_key( | ||
None, "agent_tool_metadata", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
op.create_foreign_key( | ||
None, "agents", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
op.create_foreign_key( | ||
None, "citations", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
op.create_foreign_key( | ||
None, "conversations", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
op.create_foreign_key( | ||
"document_conversation_id_user_id_fkey", | ||
"documents", | ||
"conversations", | ||
["conversation_id", "user_id"], | ||
["id", "user_id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
"file_conversation_id_user_id_fkey", | ||
"files", | ||
"conversations", | ||
["conversation_id", "user_id"], | ||
["id", "user_id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
"message_conversation_id_user_id_fkey", | ||
"messages", | ||
"conversations", | ||
["conversation_id", "user_id"], | ||
["id", "user_id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
None, "snapshot_access", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
op.create_foreign_key( | ||
None, "snapshot_links", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
op.create_foreign_key( | ||
"snapshot_conversation_id_user_id_fkey", | ||
"snapshots", | ||
"conversations", | ||
["conversation_id", "user_id"], | ||
["id", "user_id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
None, "tool_auth", "users", ["user_id"], ["id"], ondelete="CASCADE" | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_foreign_key( | ||
"snapshot_conversation_id_user_id_fkey", "snapshots", type_="foreignkey" | ||
) | ||
op.drop_foreign_key(None, "tool_auth", "users", type_="foreignkey") | ||
op.drop_foreign_key(None, "snapshot_links", "users", type_="foreignkey") | ||
op.drop_foreign_key(None, "snapshot_access", "users", type_="foreignkey") | ||
op.drop_foreign_key( | ||
"message_conversation_id_user_id_fkey", "messages", type_="foreignkey" | ||
) | ||
op.drop_foreign_key( | ||
"file_conversation_id_user_id_fkey", "files", type_="foreignkey" | ||
) | ||
op.drop_foreign_key( | ||
"document_conversation_id_user_id_fkey", "documents", type_="foreignkey" | ||
) | ||
op.drop_foreign_key(None, "conversations", "users", type_="foreignkey") | ||
op.drop_foreign_key(None, "citations", "users", type_="foreignkey") | ||
op.drop_foreign_key(None, "agents", "users", type_="foreignkey") | ||
op.drop_foreign_key(None, "agent_tool_metadata", "users", type_="foreignkey") | ||
|
||
op.drop_index("conversation_user_id_index", table_name="conversations") | ||
op.drop_constraint("conversations_pkey", "conversations", type_="primary") | ||
op.drop_constraint("conversation_id_user_id", "conversations", type_="unique") | ||
|
||
op.create_primary_key("conversations_pkey", "conversations", ["id"]) | ||
op.create_foreign_key( | ||
"snapshots_conversation_id_fkey", | ||
"snapshots", | ||
"conversations", | ||
["conversation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
"messages_conversation_id_fkey", | ||
"messages", | ||
"conversations", | ||
["conversation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
"files_conversation_id_fkey", | ||
"files", | ||
"conversations", | ||
["conversation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.create_foreign_key( | ||
"documents_conversation_id_fkey", | ||
"documents", | ||
"conversations", | ||
["conversation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
|
||
op.alter_column( | ||
"tool_auth", | ||
"user_id", | ||
existing_type=sa.String(), | ||
type_=sa.TEXT(), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"agents", | ||
"user_id", | ||
existing_type=sa.String(), | ||
type_=sa.TEXT(), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"agent_tool_metadata", | ||
"user_id", | ||
existing_type=sa.String(), | ||
type_=sa.TEXT(), | ||
existing_nullable=False, | ||
) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""empty message | ||
Revision ID: ed17f144f4bf | ||
Revises: 1acff4138b79 | ||
Create Date: 2024-07-10 10:00:50.507812 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
from src.backend.schemas.user import DEFAULT_USER_ID, DEFAULT_USER_NAME | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "ed17f144f4bf" | ||
down_revision: Union[str, None] = "1acff4138b79" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# Populate the users table with the default user | ||
op.execute( | ||
f""" | ||
INSERT INTO users (id, fullname, created_at, updated_at) | ||
VALUES ('{DEFAULT_USER_ID}', '{DEFAULT_USER_NAME}', now(), now()) | ||
ON CONFLICT (id) DO NOTHING; | ||
""" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.