Skip to content

Commit

Permalink
Fixed networking
Browse files Browse the repository at this point in the history
  • Loading branch information
kirgrim committed Feb 24, 2024
1 parent 98acc6f commit 3269628
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
19 changes: 0 additions & 19 deletions neon_llm_core/rmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,6 @@ def __init__(self):
self._personas_provider = PersonasProvider(service_name=self.name,
ovos_config=self.ovos_config)

if self.ovos_config.get("llm_bots", {}).get(self.name):
from neon_llm_core.chatbot import LLMBot
LOG.info(f"Chatbot(s) configured for: {self.name}")
for persona in self.ovos_config['llm_bots'][self.name]:
# Spawn a service for each persona to support @user requests
if not persona.get('enabled', True):
LOG.warning(f"Persona disabled: {persona['name']}")
continue
# Get a configured username to use for LLM submind connections
if mq_config.get("users", {}).get("neon_llm_submind"):
self.ovos_config["MQ"]["users"][persona['name']] = \
mq_config['users']['neon_llm_submind']
bot = LLMBot(llm_name=self.name, service_name=persona['name'],
persona=persona, config=self.ovos_config,
vhost="/chatbots")
bot.run()
LOG.info(f"Started chatbot: {bot.service_name}")
self._bots.append(bot)

def register_consumers(self):
for idx in range(self.model_config.get("num_parallel_processes", 1)):
self.register_consumer(name=f"neon_llm_{self.name}_ask_{idx}",
Expand Down
4 changes: 3 additions & 1 deletion neon_llm_core/utils/personas/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ def personas(self, data):
self._persona_handlers_state.init_default_handlers()

def _fetch_persona_config(self):
queue = "get_configured_personas"
response = send_mq_request(vhost=LLM_VHOST,
request_data={"service_name": self.service_name},
target_queue="get_configured_personas")
target_queue=queue,
response_queue=f'{queue}.{self.service_name}.response')
self.personas = response.get('items', [])
for persona in self.personas:
if persona:
Expand Down
1 change: 0 additions & 1 deletion neon_llm_core/utils/personas/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __init__(self, service_name: str, ovos_config: dict):

def init_default_handlers(self):
if self.ovos_config.get("llm_bots", {}).get(self.service_name):
from neon_llm_core.chatbot import LLMBot
LOG.info(f"Chatbot(s) configured for: {self.service_name}")
for persona in self.ovos_config['llm_bots'][self.service_name]:
self.add_persona_handler(persona=persona)
Expand Down

0 comments on commit 3269628

Please sign in to comment.