fix: complete pipeline working
User interrupts still need to be tested. ref: N25B-429
This commit is contained in:
@@ -46,12 +46,17 @@ class LLMAgent(BaseAgent):
|
||||
:param msg: The received internal message.
|
||||
"""
|
||||
if msg.sender == settings.agent_settings.bdi_core_name:
|
||||
self.logger.debug("Processing message from BDI core.")
|
||||
try:
|
||||
prompt_message = LLMPromptMessage.model_validate_json(msg.body)
|
||||
await self._process_bdi_message(prompt_message)
|
||||
except ValidationError:
|
||||
self.logger.debug("Prompt message from BDI core is invalid.")
|
||||
match msg.thread:
|
||||
case "prompt_message":
|
||||
try:
|
||||
prompt_message = LLMPromptMessage.model_validate_json(msg.body)
|
||||
await self._process_bdi_message(prompt_message)
|
||||
except ValidationError:
|
||||
self.logger.debug("Prompt message from BDI core is invalid.")
|
||||
case "assistant_message":
|
||||
self.history.append({"role": "assistant", "content": msg.body})
|
||||
case "user_message":
|
||||
self.history.append({"role": "user", "content": msg.body})
|
||||
else:
|
||||
self.logger.debug("Message ignored (not from BDI core.")
|
||||
|
||||
@@ -114,13 +119,6 @@ class LLMAgent(BaseAgent):
|
||||
:param goals: Goals the LLM should achieve.
|
||||
:yield: Fragments of the LLM-generated content (e.g., sentences/phrases).
|
||||
"""
|
||||
self.history.append(
|
||||
{
|
||||
"role": "user",
|
||||
"content": prompt,
|
||||
}
|
||||
)
|
||||
|
||||
instructions = LLMInstructions(norms if norms else None, goals if goals else None)
|
||||
messages = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user