Skip to content

Commit dcf4f23

Browse files
committed
Merge branch 'main' into query-referenced-docs
2 parents 1fa7b87 + 78bcd6a commit dcf4f23

File tree

15 files changed

+845
-59
lines changed

15 files changed

+845
-59
lines changed

README.md

Lines changed: 74 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,49 @@ The service includes comprehensive user data collection capabilities for various
1515

1616
<!-- vim-markdown-toc GFM -->
1717

18-
* [lightspeed-stack](#lightspeed-stack)
19-
* [About The Project](#about-the-project)
2018
* [Architecture](#architecture)
2119
* [Prerequisites](#prerequisites)
2220
* [Installation](#installation)
2321
* [Configuration](#configuration)
24-
* [Integration with Llama Stack](#integration-with-llama-stack)
25-
* [Llama Stack as separate server](#llama-stack-as-separate-server)
26-
* [Llama Stack project and configuration](#llama-stack-project-and-configuration)
27-
* [Check connection to Llama Stack](#check-connection-to-llama-stack)
28-
* [Llama Stack as client library](#llama-stack-as-client-library)
29-
* [System prompt](#system-prompt)
30-
* [Safety Shields](#safety-shields)
31-
* [Authentication](#authentication)
32-
* [K8s based authentication](#k8s-based-authentication)
33-
* [JSON Web Keyset based authentication](#json-web-keyset-based-authentication)
34-
* [No-op authentication](#no-op-authentication)
22+
* [Integration with Llama Stack](#integration-with-llama-stack)
23+
* [Llama Stack as separate server](#llama-stack-as-separate-server)
24+
* [MCP Server and Tool Configuration](#mcp-server-and-tool-configuration)
25+
* [Configuring MCP Servers](#configuring-mcp-servers)
26+
* [Configuring MCP Headers](#configuring-mcp-headers)
27+
* [Llama Stack project and configuration](#llama-stack-project-and-configuration)
28+
* [Check connection to Llama Stack](#check-connection-to-llama-stack)
29+
* [Llama Stack as client library](#llama-stack-as-client-library)
30+
* [User data collection](#user-data-collection)
31+
* [System prompt](#system-prompt)
32+
* [Safety Shields](#safety-shields)
33+
* [Authentication](#authentication)
34+
* [K8s based authentication](#k8s-based-authentication)
35+
* [JSON Web Keyset based authentication](#json-web-keyset-based-authentication)
36+
* [No-op authentication](#no-op-authentication)
3537
* [Usage](#usage)
36-
* [Make targets](#make-targets)
37-
* [Running Linux container image](#running-linux-container-image)
38+
* [Make targets](#make-targets)
39+
* [Running Linux container image](#running-linux-container-image)
3840
* [Endpoints](#endpoints)
39-
* [OpenAPI specification](#openapi-specification)
40-
* [Readiness Endpoint](#readiness-endpoint)
41-
* [Liveness Endpoint](#liveness-endpoint)
41+
* [OpenAPI specification](#openapi-specification)
42+
* [Readiness Endpoint](#readiness-endpoint)
43+
* [Liveness Endpoint](#liveness-endpoint)
4244
* [Publish the service as Python package on PyPI](#publish-the-service-as-python-package-on-pypi)
43-
* [Generate distribution archives to be uploaded into Python registry](#generate-distribution-archives-to-be-uploaded-into-python-registry)
44-
* [Upload distribution archives into selected Python registry](#upload-distribution-archives-into-selected-python-registry)
45-
* [Packages on PyPI and Test PyPI](#packages-on-pypi-and-test-pypi)
45+
* [Generate distribution archives to be uploaded into Python registry](#generate-distribution-archives-to-be-uploaded-into-python-registry)
46+
* [Upload distribution archives into selected Python registry](#upload-distribution-archives-into-selected-python-registry)
47+
* [Packages on PyPI and Test PyPI](#packages-on-pypi-and-test-pypi)
4648
* [Contributing](#contributing)
4749
* [Testing](#testing)
4850
* [License](#license)
4951
* [Additional tools](#additional-tools)
50-
* [Utility to generate OpenAPI schema](#utility-to-generate-openapi-schema)
51-
* [Path](#path)
52-
* [Usage](#usage-1)
53-
* [Project structure](#project-structure)
54-
* [Configuration classes](#configuration-classes)
55-
* [REST API](#rest-api)
52+
* [Utility to generate OpenAPI schema](#utility-to-generate-openapi-schema)
53+
* [Path](#path)
54+
* [Usage](#usage-1)
5655
* [Data Export Integration](#data-export-integration)
57-
56+
* [Quick Integration](#quick-integration)
57+
* [Documentation](#documentation)
58+
* [Project structure](#project-structure)
59+
* [Configuration classes](#configuration-classes)
60+
* [REST API](#rest-api)
5861

5962
<!-- vim-markdown-toc -->
6063

@@ -400,6 +403,49 @@ authentication:
400403
module: "noop-with-token"
401404
```
402405

406+
## CORS
407+
408+
It is possible to configure CORS handling. This configuration is part of service configuration:
409+
410+
```yaml
411+
service:
412+
host: localhost
413+
port: 8080
414+
auth_enabled: false
415+
workers: 1
416+
color_log: true
417+
access_log: true
418+
cors:
419+
allow_origins:
420+
- http://foo.bar.baz
421+
- http://test.com
422+
allow_credentials: true
423+
allow_methods:
424+
- *
425+
allow_headers:
426+
- *
427+
```
428+
429+
### Default values
430+
431+
```yaml
432+
cors:
433+
allow_origins:
434+
- *
435+
allow_credentials: false
436+
allow_methods:
437+
- *
438+
allow_headers:
439+
- *
440+
```
441+
442+
## Allow credentials
443+
444+
Credentials are not allowed with wildcard origins per CORS/Fetch spec.
445+
See https://fastapi.tiangolo.com/tutorial/cors/
446+
447+
448+
403449
# Usage
404450

405451
```

docs/config.png

27.3 KB
Loading

docs/config.puml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ class "AuthenticationConfiguration" as src.models.config.AuthenticationConfigura
99
skip_tls_verification : bool
1010
check_authentication_model() -> Self
1111
}
12+
class "CORSConfiguration" as src.models.config.CORSConfiguration {
13+
allow_credentials : bool
14+
allow_headers : list[str]
15+
allow_methods : list[str]
16+
allow_origins : list[str]
17+
check_cors_configuration() -> Self
18+
}
1219
class "Configuration" as src.models.config.Configuration {
13-
authentication : Optional[AuthenticationConfiguration]
20+
authentication
1421
customization : Optional[Customization]
22+
database
1523
inference
1624
llama_stack
1725
mcp_servers : list[ModelContextProtocolServer]
@@ -26,7 +34,13 @@ class "Customization" as src.models.config.Customization {
2634
system_prompt_path : Optional[FilePath]
2735
check_customization_model() -> Self
2836
}
29-
37+
class "DatabaseConfiguration" as src.models.config.DatabaseConfiguration {
38+
config
39+
db_type
40+
postgres : Optional[PostgreSQLDatabaseConfiguration]
41+
sqlite : Optional[SQLiteDatabaseConfiguration]
42+
check_database_configuration() -> Self
43+
}
3044
class "InferenceConfiguration" as src.models.config.InferenceConfiguration {
3145
default_model : Optional[str]
3246
default_provider : Optional[str]
@@ -52,10 +66,26 @@ class "ModelContextProtocolServer" as src.models.config.ModelContextProtocolServ
5266
provider_id : str
5367
url : str
5468
}
69+
class "PostgreSQLDatabaseConfiguration" as src.models.config.PostgreSQLDatabaseConfiguration {
70+
ca_cert_path : Optional[FilePath]
71+
db : str
72+
gss_encmode : str
73+
host : str
74+
namespace : Optional[str]
75+
password : str
76+
port : int
77+
ssl_mode : str
78+
user : str
79+
check_postgres_configuration() -> Self
80+
}
81+
class "SQLiteDatabaseConfiguration" as src.models.config.SQLiteDatabaseConfiguration {
82+
db_path : str
83+
}
5584
class "ServiceConfiguration" as src.models.config.ServiceConfiguration {
5685
access_log : bool
5786
auth_enabled : bool
5887
color_log : bool
88+
cors
5989
host : str
6090
port : int
6191
tls_config
@@ -75,10 +105,13 @@ class "UserDataCollection" as src.models.config.UserDataCollection {
75105
transcripts_storage : Optional[str]
76106
check_storage_location_is_set_when_needed() -> Self
77107
}
78-
108+
src.models.config.AuthenticationConfiguration --* src.models.config.Configuration : authentication
109+
src.models.config.CORSConfiguration --* src.models.config.ServiceConfiguration : cors
110+
src.models.config.DatabaseConfiguration --* src.models.config.Configuration : database
79111
src.models.config.InferenceConfiguration --* src.models.config.Configuration : inference
80112
src.models.config.JwtConfiguration --* src.models.config.JwkConfiguration : jwt_configuration
81113
src.models.config.LlamaStackConfiguration --* src.models.config.Configuration : llama_stack
114+
src.models.config.SQLiteDatabaseConfiguration --* src.models.config.DatabaseConfiguration : sqlite
82115
src.models.config.ServiceConfiguration --* src.models.config.Configuration : service
83116
src.models.config.TLSConfiguration --* src.models.config.ServiceConfiguration : tls_config
84117
src.models.config.UserDataCollection --* src.models.config.Configuration : user_data_collection

0 commit comments

Comments
 (0)