add translator

This commit is contained in:
ruslangilfanov 2025-06-22 14:57:43 +03:00
parent c9911c8abc
commit 857d15f167
No known key found for this signature in database
4 changed files with 18 additions and 11 deletions

View File

@ -2,7 +2,7 @@ from __future__ import annotations
import io
from aiogtts import aiogTTS
from aiogtts import aiogTTS # type: ignore[import-untyped]
from ..languages import LanguageEnum

View File

@ -5,6 +5,7 @@ Revises: 19fc4bee7a9f
Create Date: 2025-06-21 20:51:15.097769
"""
from typing import Sequence, Union
from alembic import op
@ -12,8 +13,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '55f95da68641'
down_revision: Union[str, None] = '19fc4bee7a9f'
revision: str = "55f95da68641"
down_revision: Union[str, None] = "19fc4bee7a9f"
branch_labels: 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:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('glossary_word', 'audio_file')
op.drop_column("glossary_word", "audio_file")
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### 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 ###

View File

@ -5,6 +5,7 @@ Revises: 55f95da68641
Create Date: 2025-06-21 20:51:29.437692
"""
from typing import Sequence, Union
from alembic import op
@ -12,8 +13,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '78357f437f61'
down_revision: Union[str, None] = '55f95da68641'
revision: str = "78357f437f61"
down_revision: Union[str, None] = "55f95da68641"
branch_labels: 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:
"""Upgrade schema."""
# ### 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 ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('glossary_word', 'audio_file')
op.drop_column("glossary_word", "audio_file")
# ### end Alembic commands ###

View File

@ -13,7 +13,7 @@ class WordInfo(pydantic.BaseModel):
lemma: str = pydantic.Field(
...,
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(
...,
@ -45,7 +45,7 @@ class WordInfo(pydantic.BaseModel):
)
category: str = pydantic.Field(
...,
description=f"semantic category in {{target_language}}",
description="semantic category in {target_language}",
)
etymology: str = pydantic.Field(
...,