Class: Llmemory::LongTerm::GraphBased::Storages::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/llmemory/long_term/graph_based/storages/base.rb

Direct Known Subclasses

ActiveRecordStorage, MemoryStorage

Instance Method Summary collapse

Instance Method Details

#archive_edge(user_id, edge_id, archived_at: nil) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 32

def archive_edge(user_id, edge_id, archived_at: nil)
  raise NotImplementedError, "#{self.class}#archive_edge must be implemented"
end

#count_edges(user_id) ⇒ Object

Raises:

  • (NotImplementedError)


48
49
50
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 48

def count_edges(user_id)
  raise NotImplementedError, "#{self.class}#count_edges must be implemented"
end

#count_nodes(user_id) ⇒ Object

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 44

def count_nodes(user_id)
  raise NotImplementedError, "#{self.class}#count_nodes must be implemented"
end

#find_edges(user_id, subject_id: nil, predicate: nil, object_id: nil, include_archived: false) ⇒ Object

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 28

def find_edges(user_id, subject_id: nil, predicate: nil, object_id: nil, include_archived: false)
  raise NotImplementedError, "#{self.class}#find_edges must be implemented"
end

#find_node_by_id(user_id, id) ⇒ Object

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 12

def find_node_by_id(user_id, id)
  raise NotImplementedError, "#{self.class}#find_node_by_id must be implemented"
end

#find_node_by_name(user_id, entity_type, name) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 16

def find_node_by_name(user_id, entity_type, name)
  raise NotImplementedError, "#{self.class}#find_node_by_name must be implemented"
end

#get_edges_around(user_id, reference, before: 5, after: 5) ⇒ Object

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 52

def get_edges_around(user_id, reference, before: 5, after: 5)
  raise NotImplementedError, "#{self.class}#get_edges_around must be implemented"
end

#list_edges(user_id, subject_id: nil, predicate: nil, limit: nil) ⇒ Object

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 40

def list_edges(user_id, subject_id: nil, predicate: nil, limit: nil)
  raise NotImplementedError, "#{self.class}#list_edges must be implemented"
end

#list_nodes(user_id, entity_type: nil, limit: nil) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 20

def list_nodes(user_id, entity_type: nil, limit: nil)
  raise NotImplementedError, "#{self.class}#list_nodes must be implemented"
end

#list_usersObject

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 36

def list_users
  raise NotImplementedError, "#{self.class}#list_users must be implemented"
end

#save_edge(user_id, edge) ⇒ Object

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 24

def save_edge(user_id, edge)
  raise NotImplementedError, "#{self.class}#save_edge must be implemented"
end

#save_node(user_id, node) ⇒ Object

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/llmemory/long_term/graph_based/storages/base.rb', line 8

def save_node(user_id, node)
  raise NotImplementedError, "#{self.class}#save_node must be implemented"
end