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

追加: SkipJsonSchemaが要らないモデルの値からSkipJsonSchemaを省いていく #1462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 8 additions & 13 deletions voicevox_engine/engine_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from typing import TypeAlias

from pydantic import BaseModel, Field, TypeAdapter
from pydantic.json_schema import SkipJsonSchema


@dataclass(frozen=True)
Expand Down Expand Up @@ -73,9 +72,7 @@ class UpdateInfo(BaseModel):

version: str = Field(description="エンジンのバージョン名")
descriptions: list[str] = Field(description="アップデートの詳細についての説明")
contributors: list[str] | SkipJsonSchema[None] = Field(
default=None, description="貢献者名"
)
contributors: list[str] | None = Field(default=None, description="貢献者名")


class LicenseInfo(BaseModel):
Expand All @@ -84,10 +81,8 @@ class LicenseInfo(BaseModel):
"""

name: str = Field(description="依存ライブラリ名")
version: str | SkipJsonSchema[None] = Field(
default=None, description="依存ライブラリのバージョン"
)
license: str | SkipJsonSchema[None] = Field(
version: str | None = Field(default=None, description="依存ライブラリのバージョン")
license: str | None = Field(
default=None, description="依存ライブラリのライセンス名"
)
text: str = Field(description="依存ライブラリのライセンス本文")
Expand All @@ -104,18 +99,18 @@ class SupportedFeatures(BaseModel):
adjust_pitch_scale: bool = Field(description="全体の音高の調整")
adjust_intonation_scale: bool = Field(description="全体の抑揚の調整")
adjust_volume_scale: bool = Field(description="全体の音量の調整")
adjust_pause_length: bool | SkipJsonSchema[None] = Field(
adjust_pause_length: bool | None = Field(
default=None, description="句読点などの無音時間の調整"
)
interrogative_upspeak: bool = Field(description="疑問文の自動調整")
synthesis_morphing: bool = Field(
description="2種類のスタイルでモーフィングした音声を合成"
)
sing: bool | SkipJsonSchema[None] = Field(default=None, description="歌唱音声合成")
manage_library: bool | SkipJsonSchema[None] = Field(
sing: bool | None = Field(default=None, description="歌唱音声合成")
manage_library: bool | None = Field(
default=None, description="音声ライブラリのインストール・アンインストール"
)
return_resource_url: bool | SkipJsonSchema[None] = Field(
return_resource_url: bool | None = Field(
default=None, description="キャラクター情報のリソースをURLで返送"
)

Expand All @@ -142,7 +137,7 @@ class EngineManifest(BaseModel):
dependency_licenses: list[LicenseInfo] = Field(
description="依存関係のライセンス情報"
)
supported_vvlib_manifest_version: str | SkipJsonSchema[None] = Field(
supported_vvlib_manifest_version: str | None = Field(
default=None, description="エンジンが対応するvvlibのバージョン"
)
supported_features: SupportedFeatures = Field(description="エンジンが持つ機能")
Expand Down
3 changes: 1 addition & 2 deletions voicevox_engine/metas/Metas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Literal, NewType

from pydantic import BaseModel, Field
from pydantic.json_schema import SkipJsonSchema

# NOTE: 循環importを防ぐためにとりあえずここに書いている
# FIXME: 他のmodelに依存せず、全modelから参照できる場所に配置する
Expand Down Expand Up @@ -59,7 +58,7 @@ class StyleInfo(BaseModel):
icon: str = Field(
description="このスタイルのアイコンをbase64エンコードしたもの、あるいはURL"
)
portrait: str | SkipJsonSchema[None] = Field(
portrait: str | None = Field(
default=None,
description="このスタイルの立ち絵画像をbase64エンコードしたもの、あるいはURL",
)
Expand Down
3 changes: 1 addition & 2 deletions voicevox_engine/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""

from pydantic import BaseModel, Field
from pydantic.json_schema import SkipJsonSchema

from voicevox_engine.tts_pipeline.model import AccentPhrase

Expand All @@ -34,7 +33,7 @@ class AudioQuery(BaseModel):
)
outputSamplingRate: int = Field(description="音声データの出力サンプリングレート")
outputStereo: bool = Field(description="音声データをステレオ出力するか否か")
kana: str | SkipJsonSchema[None] = Field(
kana: str | None = Field(
default=None,
description="[読み取り専用]AquesTalk 風記法によるテキスト。音声合成用のクエリとしては無視される",
)
Expand Down
Loading