mirror of
https://github.com/mruwnik/memory.git
synced 2025-06-08 13:24:41 +02:00
fix session id for observations
This commit is contained in:
parent
81c9ea9ed5
commit
489265fe31
@ -0,0 +1,39 @@
|
|||||||
|
"""observation session as string
|
||||||
|
|
||||||
|
Revision ID: 58439dd3088b
|
||||||
|
Revises: 77cdbfc882e2
|
||||||
|
Create Date: 2025-06-04 16:21:13.610668
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Sequence, Union
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision: str = "58439dd3088b"
|
||||||
|
down_revision: Union[str, None] = "77cdbfc882e2"
|
||||||
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
op.alter_column(
|
||||||
|
"agent_observation",
|
||||||
|
"session_id",
|
||||||
|
existing_type=sa.UUID(),
|
||||||
|
type_=sa.Text(),
|
||||||
|
existing_nullable=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
op.alter_column(
|
||||||
|
"agent_observation",
|
||||||
|
"session_id",
|
||||||
|
existing_type=sa.Text(),
|
||||||
|
type_=sa.UUID(),
|
||||||
|
existing_nullable=True,
|
||||||
|
)
|
@ -564,9 +564,7 @@ class AgentObservation(SourceItem):
|
|||||||
id = Column(
|
id = Column(
|
||||||
BigInteger, ForeignKey("source_item.id", ondelete="CASCADE"), primary_key=True
|
BigInteger, ForeignKey("source_item.id", ondelete="CASCADE"), primary_key=True
|
||||||
)
|
)
|
||||||
session_id = Column(
|
session_id = Column(Text, nullable=True)
|
||||||
UUID(as_uuid=True)
|
|
||||||
) # Groups observations from same conversation
|
|
||||||
observation_type = Column(
|
observation_type = Column(
|
||||||
Text, nullable=False
|
Text, nullable=False
|
||||||
) # belief, preference, pattern, contradiction, behavior
|
) # belief, preference, pattern, contradiction, behavior
|
||||||
|
Loading…
x
Reference in New Issue
Block a user