mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
all tests passing
This commit is contained in:
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from basic_memory.schemas import EntityIn, ObservationIn, RelationIn
|
||||
from basic_memory.schemas import EntityIn, RelationIn
|
||||
|
||||
|
||||
class FileOperationError(Exception):
|
||||
@@ -158,7 +158,7 @@ async def read_entity_file(project_entities_path: Path, entity_id: str) -> Entit
|
||||
parts = line.split(" | ", 1)
|
||||
content = parts[0]
|
||||
context = parts[1] if len(parts) > 1 else None
|
||||
observations.append(ObservationIn(content=content))
|
||||
observations.append(content)
|
||||
elif in_relations and line.startswith("- "):
|
||||
# Parse relation line: - [target_id] relation_type | context
|
||||
line = line[2:] # Remove the bullet point
|
||||
|
||||
@@ -74,7 +74,7 @@ class EntityIn(EntityBase):
|
||||
concept, etc. Each entity has a unique name, a type, and a list of
|
||||
associated observations.
|
||||
"""
|
||||
observations: List[ObservationIn] = []
|
||||
observations: List[str] = []
|
||||
relations: List[RelationIn] = []
|
||||
model_config = ConfigDict(populate_by_name=True)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ from sqlalchemy import select
|
||||
|
||||
from basic_memory.models import Observation
|
||||
from basic_memory.repository.observation_repository import ObservationRepository
|
||||
from basic_memory.schemas import ObservationIn
|
||||
from . import DatabaseSyncError
|
||||
|
||||
|
||||
@@ -19,7 +18,7 @@ class ObservationService:
|
||||
self.project_path = project_path
|
||||
self.observation_repo = observation_repo
|
||||
|
||||
async def add_observations(self, entity_id: str, observations: List[ObservationIn]) -> List[Observation]:
|
||||
async def add_observations(self, entity_id: str, observations: List[str]) -> List[Observation]:
|
||||
"""
|
||||
Add multiple observations to an entity.
|
||||
Returns the created observations with IDs set.
|
||||
|
||||
Reference in New Issue
Block a user