trustgraph-base 0.19.4__tar.gz → 0.19.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/PKG-INFO +2 -2
  2. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/api/api.py +29 -0
  3. trustgraph-base-0.19.5/trustgraph/base_version.py +1 -0
  4. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/document_embeddings_client.py +5 -1
  5. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/documents.py +17 -0
  6. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph_base.egg-info/PKG-INFO +2 -2
  7. trustgraph-base-0.19.4/trustgraph/base_version.py +0 -1
  8. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/README.md +0 -0
  9. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/setup.cfg +0 -0
  10. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/setup.py +0 -0
  11. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/api/__init__.py +0 -0
  12. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/base/__init__.py +0 -0
  13. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/base/base_processor.py +0 -0
  14. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/base/consumer.py +0 -0
  15. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/base/consumer_producer.py +0 -0
  16. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/base/producer.py +0 -0
  17. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/__init__.py +0 -0
  18. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/agent_client.py +0 -0
  19. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/base.py +0 -0
  20. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/document_rag_client.py +0 -0
  21. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/embeddings_client.py +0 -0
  22. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/graph_embeddings_client.py +0 -0
  23. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/graph_rag_client.py +0 -0
  24. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/llm_client.py +0 -0
  25. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/prompt_client.py +0 -0
  26. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/clients/triples_query_client.py +0 -0
  27. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/exceptions.py +0 -0
  28. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/knowledge/__init__.py +0 -0
  29. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/knowledge/defs.py +0 -0
  30. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/knowledge/document.py +0 -0
  31. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/knowledge/identifier.py +0 -0
  32. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/knowledge/organization.py +0 -0
  33. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/knowledge/publication.py +0 -0
  34. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/log_level.py +0 -0
  35. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/objects/__init__.py +0 -0
  36. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/objects/field.py +0 -0
  37. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/objects/object.py +0 -0
  38. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/rdf.py +0 -0
  39. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/__init__.py +0 -0
  40. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/agent.py +0 -0
  41. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/graph.py +0 -0
  42. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/lookup.py +0 -0
  43. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/metadata.py +0 -0
  44. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/models.py +0 -0
  45. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/object.py +0 -0
  46. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/prompt.py +0 -0
  47. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/retrieval.py +0 -0
  48. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/topic.py +0 -0
  49. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph/schema/types.py +0 -0
  50. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph_base.egg-info/SOURCES.txt +0 -0
  51. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph_base.egg-info/dependency_links.txt +0 -0
  52. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph_base.egg-info/requires.txt +0 -0
  53. {trustgraph-base-0.19.4 → trustgraph-base-0.19.5}/trustgraph_base.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-base
3
- Version: 0.19.4
3
+ Version: 0.19.5
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
6
  Author: trustgraph.ai
7
7
  Author-email: security@trustgraph.ai
8
8
  License: UNKNOWN
9
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.19.4.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.19.5.tar.gz
10
10
  Platform: UNKNOWN
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -131,6 +131,35 @@ class Api:
131
131
  except:
132
132
  raise ProtocolException(f"Response not formatted correctly")
133
133
 
134
+ def document_rag(self, question):
135
+
136
+ # The input consists of a question
137
+ input = {
138
+ "query": question
139
+ }
140
+
141
+ url = f"{self.url}document-rag"
142
+
143
+ # Invoke the API, input is passed as JSON
144
+ resp = requests.post(url, json=input)
145
+
146
+ # Should be a 200 status code
147
+ if resp.status_code != 200:
148
+ raise ProtocolException(f"Status code {resp.status_code}")
149
+
150
+ try:
151
+ # Parse the response as JSON
152
+ object = resp.json()
153
+ except:
154
+ raise ProtocolException(f"Expected JSON response")
155
+
156
+ self.check_error(resp)
157
+
158
+ try:
159
+ return object["response"]
160
+ except:
161
+ raise ProtocolException(f"Response not formatted correctly")
162
+
134
163
  def embeddings(self, text):
135
164
 
136
165
  # The input consists of a text block
@@ -0,0 +1 @@
1
+ __version__ = "0.19.5"
@@ -38,8 +38,12 @@ class DocumentEmbeddingsClient(BaseClient):
38
38
  output_schema=DocumentEmbeddingsResponse,
39
39
  )
40
40
 
41
- def request(self, vectors, limit=10, timeout=300):
41
+ def request(
42
+ self, vectors, user="trustgraph", collection="default",
43
+ limit=10, timeout=300
44
+ ):
42
45
  return self.call(
46
+ user=user, collection=collection,
43
47
  vectors=vectors, limit=limit, timeout=timeout
44
48
  ).documents
45
49
 
@@ -35,11 +35,28 @@ chunk_ingest_queue = topic('chunk-load')
35
35
 
36
36
  ############################################################################
37
37
 
38
+ # Document embeddings are embeddings associated with a chunk
39
+
40
+ class ChunkEmbeddings(Record):
41
+ chunk = Bytes()
42
+ vectors = Array(Array(Double()))
43
+
44
+ # This is a 'batching' mechanism for the above data
45
+ class DocumentEmbeddings(Record):
46
+ metadata = Metadata()
47
+ chunks = Array(ChunkEmbeddings())
48
+
49
+ document_embeddings_store_queue = topic('document-embeddings-store')
50
+
51
+ ############################################################################
52
+
38
53
  # Doc embeddings query
39
54
 
40
55
  class DocumentEmbeddingsRequest(Record):
41
56
  vectors = Array(Array(Double()))
42
57
  limit = Integer()
58
+ user = String()
59
+ collection = String()
43
60
 
44
61
  class DocumentEmbeddingsResponse(Record):
45
62
  error = Error()
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-base
3
- Version: 0.19.4
3
+ Version: 0.19.5
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
6
  Author: trustgraph.ai
7
7
  Author-email: security@trustgraph.ai
8
8
  License: UNKNOWN
9
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.19.4.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.19.5.tar.gz
10
10
  Platform: UNKNOWN
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -1 +0,0 @@
1
- __version__ = "0.19.4"