Skip to main content

apollo_settings

Apollo Config & Pydantic Settings

Install

pip install apollo-settings

Usage

import time
from apollo_settings import ApolloSettings, ApolloSettingsConfigDict


class MySettings(ApolloSettings):
    model_config = ApolloSettingsConfigDict(
        meta_url='your_meta_url',
        app_id='your_app_id',
    )

    openai_api_base: str = 'test'
    rerank_model: str = 'test'
    rerank_threshold: float = 0.2


class ChatEninge:

    def __init__(self, rerank_model: str) -> None:
        self.rerank_model = rerank_model
    
    def update_model(self, settings: MySettings):
        self.rerank_model = settings.rerank_model


settings = MySettings()
engine = ChatEninge(rerank_model=settings.rerank_model)
settings.on_change(engine.update_model, fields=['rerank_model'])
print(settings)
print(engine.rerank_model)
time.sleep(1)
print(settings)
print(engine.rerank_model)

ApolloClient code from @crowod

Metadata

Release files for apollo-settings 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apollo-settings 0.2.0
File Size Uploaded
apollo_settings-0.2.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apollo-settings 0.2.0
File Interpreter ABI Platform
apollo_settings-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / apollo_settings-0.2.0.tar.gz

Download URL apollo_settings-0.2.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fa972c64df0c427900466ee56c4d5902c180ee28e642e578b49f31b899194a3d
BLAKE2b-256 checksum
How to use checksums
f48c1caa6766ad3432ef27a0a680113f247aae459969a2a9ed84f6088c387a4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.0 Linux/6.5.0-1016-azure

Release files / apollo_settings-0.2.0-py3-none-any.whl

Download URL apollo_settings-0.2.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f603bd458b9577dd346c3eec89ee51236ddd4ef9f6430c22fb049cc6c3ea82e9
BLAKE2b-256 checksum
How to use checksums
bf3b53806f9fd6f33c3c291b96e408a9584857dfcaccb3bff6d6028967d310e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.0 Linux/6.5.0-1016-azure

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page