forked from pingcap/autoflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): support ollama llm; support ollama, jina, cohere embed…
…ding (pingcap#247)
- Loading branch information
Showing
21 changed files
with
299 additions
and
68 deletions.
There are no files selected for viewing
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,76 @@ | ||
"""empty message | ||
Revision ID: 00534dc350db | ||
Revises: 10f36e8a25c4 | ||
Create Date: 2024-08-26 12:46:00.203425 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "00534dc350db" | ||
down_revision = "10f36e8a25c4" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"embedding_models", | ||
"provider", | ||
existing_type=mysql.ENUM("OPENAI"), | ||
type_=sa.String(length=32), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"llms", | ||
"provider", | ||
existing_type=mysql.ENUM( | ||
"OPENAI", "GEMINI", "ANTHROPIC_VERTEX", "OPENAI_LIKE", "BEDROCK" | ||
), | ||
type_=sa.String(length=32), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"reranker_models", | ||
"provider", | ||
existing_type=mysql.ENUM("JINA", "COHERE", "BAISHENG"), | ||
type_=sa.String(length=32), | ||
existing_nullable=False, | ||
) | ||
op.execute("UPDATE embedding_models SET provider = lower(provider)") | ||
op.execute("UPDATE llms SET provider = lower(provider)") | ||
op.execute("UPDATE reranker_models SET provider = lower(provider)") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"reranker_models", | ||
"provider", | ||
existing_type=sa.String(length=32), | ||
type_=mysql.ENUM("JINA", "COHERE", "BAISHENG"), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"llms", | ||
"provider", | ||
existing_type=sa.String(length=32), | ||
type_=mysql.ENUM( | ||
"OPENAI", "GEMINI", "ANTHROPIC_VERTEX", "OPENAI_LIKE", "BEDROCK" | ||
), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"embedding_models", | ||
"provider", | ||
existing_type=sa.String(length=32), | ||
type_=mysql.ENUM("OPENAI"), | ||
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
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
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
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
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
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
Oops, something went wrong.