Skip to content

Commit

Permalink
Merge branch 'main' of github.com:road-core/service into chat-history
Browse files Browse the repository at this point in the history
  • Loading branch information
yangcao77 committed Jan 22, 2025
2 parents ea52586 + 4c72419 commit df3820b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ config.puml: ## Generate PlantUML class diagram for configuration
mv docs/classes.puml docs/config.puml

llms.puml: ## Generate PlantUML class diagram for LLM plugin system
pyreverse ols/src/llms/ --output puml --output-directory=docs
pyreverse ols/src/llms/ --output puml --output-directory=docs/
mv docs/classes.puml docs/llms_classes.uml
mv docs/packages.puml docs/llms_packages.uml

distribution-archives: ## Generate distribution archives to be uploaded into Python registry
pdm run python -m build
Expand Down
Binary file modified docs/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/config.puml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class "DevConfig" as ols.app.models.config.DevConfig {
llm_params : dict
pyroscope_url : Optional[str]
run_on_localhost : bool
uvicorn_port_number : Optional[int]
}
class "InMemoryCacheConfig" as ols.app.models.config.InMemoryCacheConfig {
max_entries : Optional[int]
Expand Down
6 changes: 4 additions & 2 deletions ols/app/endpoints/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def feedback_status() -> StatusResponse:
Response indicating the status of the feedback.
"""
logger.debug("feedback status request received")
feedback_status = is_feedback_enabled()
return StatusResponse(functionality="feedback", status={"enabled": feedback_status})
feedback_status_enabled = is_feedback_enabled()
return StatusResponse(
functionality="feedback", status={"enabled": feedback_status_enabled}
)


post_feedback_responses: dict[int | str, dict[str, Any]] = {
Expand Down
12 changes: 6 additions & 6 deletions ols/utils/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def min_tls_version(
tls_profile: TLSProfiles,
) -> Optional[ssl.TLSVersion]:
"""Retrieve minimal TLS version for the profile or for the current profile configuration."""
min_tls_version = specified_tls_version
if min_tls_version is None:
min_tls_version_specified = specified_tls_version
if min_tls_version_specified is None:
return MIN_TLS_VERSIONS[tls_profile]
return min_tls_version
return min_tls_version_specified


def ciphers_from_list(ciphers: Optional[list[str]]) -> Optional[str]:
Expand All @@ -136,7 +136,7 @@ def ciphers_as_string(
ciphers: Optional[list[str]], tls_profile: TLSProfiles
) -> Optional[str]:
"""Retrieve ciphers as one string for custom list of TLS profile-based list."""
ciphers_as_string = ciphers_from_list(ciphers)
if ciphers_as_string is None:
ciphers_as_str = ciphers_from_list(ciphers)
if ciphers_as_str is None:
return ciphers_for_tls_profile(tls_profile)
return ciphers_as_string
return ciphers_as_str
4 changes: 2 additions & 2 deletions tests/e2e/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def teardown_module(module):
must_gather()


@pytest.fixture(scope="module")
def postgres_connection():
@pytest.fixture(name="postgres_connection", scope="module")
def fixture_postgres_connection():
"""Fixture with Postgres connection."""
return retrieve_connection()

Expand Down

0 comments on commit df3820b

Please sign in to comment.