vdoc.models.plugins package

Submodules

vdoc.models.plugins.base module

Contains the base class for all plugins.

class vdoc.models.plugins.base.Plugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: BaseSettings, ABC

Plugin model for VDoc.

abstract property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

classmethod load_plugins()

Load all plugins.

Raises:

Exception – If an plugin fails to load.

Yields:

Generator[Plugin, None, None] – A generator of loaded plugin instances.

Return type:

Generator[Plugin, None, None]

model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: ValidPluginsT
property router: APIRouter

Get the router for the plugin.

Returns:

The FastAPI router for the plugin.

Return type:

APIRouter

vdoc.models.plugins.footer module

Contains the footer plugin.

Bases: BaseModel

Pydantic model for a footer link.

href: AnyUrl
icon: Literal['email', 'support', 'public', 'bugs', 'github', 'home']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

target: Literal['_blank', '_self', '_parent', '_top']
title: str
class vdoc.models.plugins.footer.FooterLinkGroup(**data)

Bases: BaseModel

Pydantic model for a footer link group.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

title: str
class vdoc.models.plugins.footer.FooterPlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: Plugin

Footer plugin model for vdoc.

property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

copyright: str | None
model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_footer_'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: Literal['theme', 'orama', 'footer']

vdoc.models.plugins.orama module

Contains the orama plugin.

class vdoc.models.plugins.orama.OramaDictionary(**data)

Bases: BaseModel

Custom text dictionary for localization.

add_more: str | None
chat_button_label: str | None
chat_placeholder: str | None
clear_chat: str | None
disclaimer: str | None
error_message: str | None
init_error_chat: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

no_results_found: str | None
no_results_found_for: str | None
search_button_label: str | None
search_placeholder: str | None
see_all: str | None
suggestions: list[str] | None
class vdoc.models.plugins.orama.OramaPlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: Plugin

Orama plugin model for vdoc.

property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

api_key: str | None
dictionary: OramaDictionary | None
disable_chat: bool
endpoint: AnyHttpUrl | None
facet_property: str | None
model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_orama_'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: Literal['theme', 'orama', 'footer']

vdoc.models.plugins.theme module

Contains the theme plugin.

class vdoc.models.plugins.theme.ThemePlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: Plugin

Theme plugin model for vdoc.

property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

dark: ThemeSettings
light: ThemeSettings
model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_theme_'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: Literal['theme', 'orama', 'footer']
class vdoc.models.plugins.theme.ThemeSettings(**data)

Bases: BaseModel

Mode-based settings for the theme plugin.

logo_url: AnyHttpUrl | None
logo_url_small: AnyHttpUrl | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Module contents

Contains all plugins models.

class vdoc.models.plugins.FooterPlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: Plugin

Footer plugin model for vdoc.

property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

copyright: str | None
model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_footer_'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: Literal['theme', 'orama', 'footer']
class vdoc.models.plugins.OramaPlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: Plugin

Orama plugin model for vdoc.

property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

api_key: str | None
dictionary: OramaDictionary | None
disable_chat: bool
endpoint: AnyHttpUrl | None
facet_property: str | None
model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_orama_'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: Literal['theme', 'orama', 'footer']
class vdoc.models.plugins.ThemePlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)

Bases: Plugin

Theme plugin model for vdoc.

property active: bool

Check if the plugin is active.

Returns:

True if the plugin is active, False otherwise.

dark: ThemeSettings
light: ThemeSettings
model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_theme_'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

name: Literal['theme', 'orama', 'footer']