refactor: use explicit dependency injection for groq_api_key
This commit is contained in:
@@ -36,10 +36,10 @@ class ChannelManager:
|
||||
if self.config.channels.telegram.enabled:
|
||||
try:
|
||||
from nanobot.channels.telegram import TelegramChannel
|
||||
# Inject parent config for access to providers
|
||||
self.config.channels.telegram.parent = self.config
|
||||
self.channels["telegram"] = TelegramChannel(
|
||||
self.config.channels.telegram, self.bus
|
||||
self.config.channels.telegram,
|
||||
self.bus,
|
||||
groq_api_key=self.config.providers.groq.api_key,
|
||||
)
|
||||
logger.info("Telegram channel enabled")
|
||||
except ImportError as e:
|
||||
@@ -49,8 +49,6 @@ class ChannelManager:
|
||||
if self.config.channels.whatsapp.enabled:
|
||||
try:
|
||||
from nanobot.channels.whatsapp import WhatsAppChannel
|
||||
# Inject parent config for access to providers
|
||||
self.config.channels.whatsapp.parent = self.config
|
||||
self.channels["whatsapp"] = WhatsAppChannel(
|
||||
self.config.channels.whatsapp, self.bus
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user