diff --git a/docs/config.png b/docs/config.png index e9cf9022..11b5064c 100644 Binary files a/docs/config.png and b/docs/config.png differ diff --git a/docs/config.puml b/docs/config.puml index 492e564c..9bc91c67 100644 --- a/docs/config.puml +++ b/docs/config.puml @@ -29,6 +29,7 @@ class "CORSConfiguration" as src.models.config.CORSConfiguration { class "Configuration" as src.models.config.Configuration { authentication : Optional[AuthenticationConfiguration] authorization : Optional[AuthorizationConfiguration] + conversation_cache : Optional[ConversationCache] customization : Optional[Customization] database : Optional[DatabaseConfiguration] inference : Optional[InferenceConfiguration] @@ -42,8 +43,22 @@ class "Configuration" as src.models.config.Configuration { class "ConfigurationBase" as src.models.config.ConfigurationBase { model_config } +class "ConversationCache" as src.models.config.ConversationCache { + memory : Optional[InMemoryCacheConfig] + postgres : Optional[PostgreSQLDatabaseConfiguration] + sqlite : Optional[SQLiteDatabaseConfiguration] + type : Literal['memory', 'sqlite', 'postgres'] | None + check_cache_configuration() -> Self +} +class "CustomProfile" as src.models.config.CustomProfile { + path : str + prompts : Optional[dict[str, str]] + get_prompts() -> dict[str, str] +} class "Customization" as src.models.config.Customization { + custom_profile : Optional[CustomProfile] disable_query_system_prompt : bool + profile_path : Optional[str] system_prompt : Optional[str] system_prompt_path : Optional[FilePath] check_customization_model() -> Self @@ -55,6 +70,9 @@ class "DatabaseConfiguration" as src.models.config.DatabaseConfiguration { sqlite : Optional[SQLiteDatabaseConfiguration] check_database_configuration() -> Self } +class "InMemoryCacheConfig" as src.models.config.InMemoryCacheConfig { + max_entries : Annotated +} class "InferenceConfiguration" as src.models.config.InferenceConfiguration { default_model : Optional[str] default_provider : Optional[str] @@ -139,8 +157,10 @@ src.models.config.AuthenticationConfiguration --|> src.models.config.Configurati src.models.config.AuthorizationConfiguration --|> src.models.config.ConfigurationBase src.models.config.CORSConfiguration --|> src.models.config.ConfigurationBase src.models.config.Configuration --|> src.models.config.ConfigurationBase +src.models.config.ConversationCache --|> src.models.config.ConfigurationBase src.models.config.Customization --|> src.models.config.ConfigurationBase src.models.config.DatabaseConfiguration --|> src.models.config.ConfigurationBase +src.models.config.InMemoryCacheConfig --|> src.models.config.ConfigurationBase src.models.config.InferenceConfiguration --|> src.models.config.ConfigurationBase src.models.config.JwkConfiguration --|> src.models.config.ConfigurationBase src.models.config.JwtConfiguration --|> src.models.config.ConfigurationBase @@ -152,6 +172,7 @@ src.models.config.SQLiteDatabaseConfiguration --|> src.models.config.Configurati src.models.config.ServiceConfiguration --|> src.models.config.ConfigurationBase src.models.config.TLSConfiguration --|> src.models.config.ConfigurationBase src.models.config.UserDataCollection --|> src.models.config.ConfigurationBase +src.models.config.CustomProfile --* src.models.config.Customization : custom_profile src.models.config.JsonPathOperator --* src.models.config.JwtRoleRule : operator src.models.config.LlamaStackConfiguration --* src.models.config.Configuration : llama_stack src.models.config.SQLiteDatabaseConfiguration --* src.models.config.DatabaseConfiguration : sqlite diff --git a/docs/config.svg b/docs/config.svg index 358724d1..cab23cd5 100644 --- a/docs/config.svg +++ b/docs/config.svg @@ -1,408 +1,463 @@ - + - - - - AccessRule - - actions : list[Action] - role : str - + + + + AccessRule + + actions : list[Action] + role : str + - - - - Action - - name - + + + + Action + + name + - - - - AuthenticationConfiguration - - jwk_config : Optional[JwkConfiguration] - jwk_configuration - k8s_ca_cert_path : Optional[FilePath] - k8s_cluster_api : Optional[AnyHttpUrl] - module : str - skip_tls_verification : bool - - check_authentication_model() -> Self + + + + AuthenticationConfiguration + + jwk_config : Optional[JwkConfiguration] + jwk_configuration + k8s_ca_cert_path : Optional[FilePath] + k8s_cluster_api : Optional[AnyHttpUrl] + module : str + skip_tls_verification : bool + + check_authentication_model() -> Self - - - - AuthorizationConfiguration - - access_rules : Optional[list[AccessRule]] - + + + + AuthorizationConfiguration + + access_rules : Optional[list[AccessRule]] + - - - - CORSConfiguration - - allow_credentials : bool - allow_headers : list[str] - allow_methods : list[str] - allow_origins : list[str] - - check_cors_configuration() -> Self + + + + CORSConfiguration + + allow_credentials : bool + allow_headers : list[str] + allow_methods : list[str] + allow_origins : list[str] + + check_cors_configuration() -> Self - - - - Configuration - - authentication : Optional[AuthenticationConfiguration] - authorization : Optional[AuthorizationConfiguration] - customization : Optional[Customization] - database : Optional[DatabaseConfiguration] - inference : Optional[InferenceConfiguration] - llama_stack - mcp_servers : Optional[list[ModelContextProtocolServer]] - name : str - service - user_data_collection - - dump(filename: str) -> None + + + + Configuration + + authentication : Optional[AuthenticationConfiguration] + authorization : Optional[AuthorizationConfiguration] + conversation_cache : Optional[ConversationCache] + customization : Optional[Customization] + database : Optional[DatabaseConfiguration] + inference : Optional[InferenceConfiguration] + llama_stack + mcp_servers : Optional[list[ModelContextProtocolServer]] + name : str + service + user_data_collection + + dump(filename: str) -> None - - - - ConfigurationBase - - model_config - + + + + ConfigurationBase + + model_config + + + + + + + + ConversationCache + + memory : Optional[InMemoryCacheConfig] + postgres : Optional[PostgreSQLDatabaseConfiguration] + sqlite : Optional[SQLiteDatabaseConfiguration] + type : Literal['memory', 'sqlite', 'postgres'] | None + + check_cache_configuration() -> Self + + + + + + + CustomProfile + + path : str + prompts : Optional[dict[str, str]] + + get_prompts() -> dict[str, str] - - - - Customization - - disable_query_system_prompt : bool - system_prompt : Optional[str] - system_prompt_path : Optional[FilePath] - - check_customization_model() -> Self + + + + Customization + + custom_profile : Optional[CustomProfile] + disable_query_system_prompt : bool + profile_path : Optional[str] + system_prompt : Optional[str] + system_prompt_path : Optional[FilePath] + + check_customization_model() -> Self - - - - DatabaseConfiguration - - config - db_type - postgres : Optional[PostgreSQLDatabaseConfiguration] - sqlite : Optional[SQLiteDatabaseConfiguration] - - check_database_configuration() -> Self + + + + DatabaseConfiguration + + config + db_type + postgres : Optional[PostgreSQLDatabaseConfiguration] + sqlite : Optional[SQLiteDatabaseConfiguration] + + check_database_configuration() -> Self + + + + + + + InMemoryCacheConfig + + max_entries : Annotated + - - - - InferenceConfiguration - - default_model : Optional[str] - default_provider : Optional[str] - - check_default_model_and_provider() -> Self + + + + InferenceConfiguration + + default_model : Optional[str] + default_provider : Optional[str] + + check_default_model_and_provider() -> Self - - - - JsonPathOperator - - name - + + + + JsonPathOperator + + name + - - - - JwkConfiguration - - jwt_configuration : Optional[JwtConfiguration] - url : AnyHttpUrl - + + + + JwkConfiguration + + jwt_configuration : Optional[JwtConfiguration] + url : AnyHttpUrl + - - - - JwtConfiguration - - role_rules : Optional[list[JwtRoleRule]] - user_id_claim : str - username_claim : str - + + + + JwtConfiguration + + role_rules : Optional[list[JwtRoleRule]] + user_id_claim : str + username_claim : str + - - - - JwtRoleRule - - compiled_regex - jsonpath : str - negate : bool - operator - roles : list[str] - value : Any - - check_jsonpath() -> Self - check_regex_pattern() -> Self - check_roles() -> Self + + + + JwtRoleRule + + compiled_regex + jsonpath : str + negate : bool + operator + roles : list[str] + value : Any + + check_jsonpath() -> Self + check_regex_pattern() -> Self + check_roles() -> Self - - - - LlamaStackConfiguration - - api_key : Optional[SecretStr] - library_client_config_path : Optional[str] - url : Optional[str] - use_as_library_client : Optional[bool] - - check_llama_stack_model() -> Self + + + + LlamaStackConfiguration + + api_key : Optional[SecretStr] + library_client_config_path : Optional[str] + url : Optional[str] + use_as_library_client : Optional[bool] + + check_llama_stack_model() -> Self - - - - ModelContextProtocolServer - - name : str - provider_id : str - url : str - + + + + ModelContextProtocolServer + + name : str + provider_id : str + url : str + - - - - PostgreSQLDatabaseConfiguration - - ca_cert_path : Optional[FilePath] - db : str - gss_encmode : str - host : str - namespace : Optional[str] - password : SecretStr - port : Annotated - ssl_mode : str - user : str - - check_postgres_configuration() -> Self + + + + PostgreSQLDatabaseConfiguration + + ca_cert_path : Optional[FilePath] + db : str + gss_encmode : str + host : str + namespace : Optional[str] + password : SecretStr + port : Annotated + ssl_mode : str + user : str + + check_postgres_configuration() -> Self - - - - SQLiteDatabaseConfiguration - - db_path : str - + + + + SQLiteDatabaseConfiguration + + db_path : str + - - - - ServiceConfiguration - - access_log : bool - auth_enabled : bool - color_log : bool - cors : Optional[CORSConfiguration] - host : str - port : Annotated - tls_config : Optional[TLSConfiguration] - workers : Annotated - - check_service_configuration() -> Self + + + + ServiceConfiguration + + access_log : bool + auth_enabled : bool + color_log : bool + cors : Optional[CORSConfiguration] + host : str + port : Annotated + tls_config : Optional[TLSConfiguration] + workers : Annotated + + check_service_configuration() -> Self - - - - TLSConfiguration - - tls_certificate_path : Optional[FilePath] - tls_key_password : Optional[FilePath] - tls_key_path : Optional[FilePath] - - check_tls_configuration() -> Self + + + + TLSConfiguration + + tls_certificate_path : Optional[FilePath] + tls_key_password : Optional[FilePath] + tls_key_path : Optional[FilePath] + + check_tls_configuration() -> Self - - - - UserDataCollection - - feedback_enabled : bool - feedback_storage : Optional[str] - transcripts_enabled : bool - transcripts_storage : Optional[str] - - check_storage_location_is_set_when_needed() -> Self + + + + UserDataCollection + + feedback_enabled : bool + feedback_storage : Optional[str] + transcripts_enabled : bool + transcripts_storage : Optional[str] + + check_storage_location_is_set_when_needed() -> Self - - + + - - + + - - + + - - + + - - + + + + + + + - - + + - - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + custom_profile - - - operator + + + operator - - - llama_stack + + + llama_stack - - - sqlite + + + sqlite - - - service + + + service - - - user_data_collection + + + user_data_collection - +