add translator
This commit is contained in:
parent
c9911c8abc
commit
857d15f167
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import io
|
import io
|
||||||
|
|
||||||
from aiogtts import aiogTTS
|
from aiogtts import aiogTTS # type: ignore[import-untyped]
|
||||||
|
|
||||||
from ..languages import LanguageEnum
|
from ..languages import LanguageEnum
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ Revises: 19fc4bee7a9f
|
|||||||
Create Date: 2025-06-21 20:51:15.097769
|
Create Date: 2025-06-21 20:51:15.097769
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
@ -12,8 +13,8 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '55f95da68641'
|
revision: str = "55f95da68641"
|
||||||
down_revision: Union[str, None] = '19fc4bee7a9f'
|
down_revision: Union[str, None] = "19fc4bee7a9f"
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
@ -21,12 +22,15 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
"""Upgrade schema."""
|
"""Upgrade schema."""
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.drop_column('glossary_word', 'audio_file')
|
op.drop_column("glossary_word", "audio_file")
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
"""Downgrade schema."""
|
"""Downgrade schema."""
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.add_column('glossary_word', sa.Column('audio_file', sa.TEXT(), autoincrement=False, nullable=True))
|
op.add_column(
|
||||||
|
"glossary_word",
|
||||||
|
sa.Column("audio_file", sa.TEXT(), autoincrement=False, nullable=True),
|
||||||
|
)
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|||||||
@ -5,6 +5,7 @@ Revises: 55f95da68641
|
|||||||
Create Date: 2025-06-21 20:51:29.437692
|
Create Date: 2025-06-21 20:51:29.437692
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Sequence, Union
|
from typing import Sequence, Union
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
@ -12,8 +13,8 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = '78357f437f61'
|
revision: str = "78357f437f61"
|
||||||
down_revision: Union[str, None] = '55f95da68641'
|
down_revision: Union[str, None] = "55f95da68641"
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
@ -21,12 +22,14 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
"""Upgrade schema."""
|
"""Upgrade schema."""
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.add_column('glossary_word', sa.Column('audio_file', sa.LargeBinary(), nullable=True))
|
op.add_column(
|
||||||
|
"glossary_word", sa.Column("audio_file", sa.LargeBinary(), nullable=True)
|
||||||
|
)
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
"""Downgrade schema."""
|
"""Downgrade schema."""
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.drop_column('glossary_word', 'audio_file')
|
op.drop_column("glossary_word", "audio_file")
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class WordInfo(pydantic.BaseModel):
|
|||||||
lemma: str = pydantic.Field(
|
lemma: str = pydantic.Field(
|
||||||
...,
|
...,
|
||||||
description="lemma (base form) - for verbs, use the 1st person singular in present indicative, "
|
description="lemma (base form) - for verbs, use the 1st person singular in present indicative, "
|
||||||
"for nouns and adjectives, use the nominative singular masculine (for adjectives)",
|
"for nouns and adjectives, use the nominative singular masculine (for adjectives)",
|
||||||
)
|
)
|
||||||
transcription: str = pydantic.Field(
|
transcription: str = pydantic.Field(
|
||||||
...,
|
...,
|
||||||
@ -45,7 +45,7 @@ class WordInfo(pydantic.BaseModel):
|
|||||||
)
|
)
|
||||||
category: str = pydantic.Field(
|
category: str = pydantic.Field(
|
||||||
...,
|
...,
|
||||||
description=f"semantic category in {{target_language}}",
|
description="semantic category in {target_language}",
|
||||||
)
|
)
|
||||||
etymology: str = pydantic.Field(
|
etymology: str = pydantic.Field(
|
||||||
...,
|
...,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user