Skip to content

Commit

Permalink
feat: Add optional config loading in Context initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure99 committed Feb 22, 2025
1 parent 9df911d commit da3e7a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blossom/context/context.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from typing import Any, Optional

from blossom.conf.config import Config
from blossom.conf.config import Config, load_config
from blossom.context.provider_manager import ProviderManager
from blossom.provider.base_provider import BaseProvider
from blossom.provider.protocol import ChatCompletionResponse
from blossom.schema.chat_schema import ChatMessage


class Context:
def __init__(self, config: Config) -> None:
self.config = config
self.provider_manager = ProviderManager(config=config)
def __init__(self, config: Optional[Config] = None) -> None:
self.config = config or load_config()
self.provider_manager = ProviderManager(config=self.config)

def get_config(self) -> Config:
return self.config
Expand Down

0 comments on commit da3e7a4

Please sign in to comment.