mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Refactor to a helper class for the agent's history (ConversationMemory) (#7008)
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Calvin Smith <email@cjsmith.io>
This commit is contained in:
@@ -310,7 +310,7 @@ class InvariantAnalyzer(SecurityAnalyzer):
|
||||
check_result = self.monitor.check(self.input, input)
|
||||
self.input.extend(input)
|
||||
risk = ActionSecurityRisk.UNKNOWN
|
||||
|
||||
|
||||
if isinstance(check_result, tuple):
|
||||
result, err = check_result
|
||||
if err:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Iterable, Tuple
|
||||
from typing import Any, Iterable
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic.dataclasses import dataclass
|
||||
|
||||
@@ -31,7 +32,9 @@ class Message(Event):
|
||||
content: str | None
|
||||
tool_calls: list[ToolCall] | None = None
|
||||
|
||||
def __rich_repr__(self) -> Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]:
|
||||
def __rich_repr__(
|
||||
self,
|
||||
) -> Iterable[Any | tuple[Any] | tuple[str, Any] | tuple[str, Any, Any]]:
|
||||
# Print on separate line
|
||||
yield 'role', self.role
|
||||
yield 'content', self.content
|
||||
|
||||
Reference in New Issue
Block a user