Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hyperforge/src/hyperforge/memory/memory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from collections import OrderedDict
from datetime import datetime, timezone
from typing import Awaitable, Callable, Dict, List, Optional, Tuple, Union, cast
from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union, cast
from uuid import uuid4

from nuclia.lib.nua_responses import Author, Image, Message
Expand Down Expand Up @@ -74,6 +74,8 @@ def _qa_list_to_chat_messages(history: List[HistoryQuestionAnswer]) -> List[Mess
Message(author=Author.NUCLIA, text=qa.answer),
)
]


CONTEXT_FIELD: str = "context"
STEPS_FIELD: str = "steps"
USER_INFO_FIELD: str = "user_info"
Expand Down Expand Up @@ -817,6 +819,7 @@ async def add_step(
step_value: Optional[str] = None,
step_reason: Optional[str] = None,
error: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
):
new_step = Step(
original_question_uuid=self.original_question_uuid,
Expand All @@ -830,6 +833,7 @@ async def add_step(
input_nuclia_tokens=input_nuclia_tokens,
output_nuclia_tokens=output_nuclia_tokens,
error=error,
metadata=metadata,
)
self.steps.append(new_step)
if self.callback_fn is not None:
Expand Down
Loading