MCPcopy
hub / github.com/llmware-ai/llmware / embedding_key_lookup

Method embedding_key_lookup

llmware/resources.py:1012–1028  ·  view source on GitHub ↗
(self, key, value)

Source from the content-addressed store, hash-verified

1010 return output
1011
1012 def embedding_key_lookup(self, key, value):
1013
1014 # lookup in json dictionary - special sql command
1015 output = []
1016 value = str(value)
1017
1018 sql_query= f"SELECT * FROM {self.library_name} WHERE embedding_flags->>'{key}' = '{value}'"
1019
1020 results = list(self.conn.cursor().execute(sql_query))
1021
1022 if results:
1023 if len(results) >= 1:
1024 output = self.unpack(results)
1025
1026 self.conn.close()
1027
1028 return output
1029
1030 def get_whole_collection(self):
1031

Callers 1

embedding_key_lookupMethod · 0.45

Calls 2

unpackMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected