trustgraph-base 0.23.2__tar.gz → 0.23.4__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 (85) hide show
  1. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/PKG-INFO +2 -2
  2. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/async_processor.py +1 -1
  3. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/consumer_spec.py +1 -1
  4. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/flow_processor.py +2 -1
  5. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/publisher.py +6 -2
  6. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/request_response_spec.py +3 -1
  7. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/subscriber.py +17 -6
  8. trustgraph-base-0.23.4/trustgraph/base_version.py +1 -0
  9. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph_base.egg-info/PKG-INFO +2 -2
  10. trustgraph-base-0.23.2/trustgraph/base_version.py +0 -1
  11. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/README.md +0 -0
  12. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/setup.cfg +0 -0
  13. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/setup.py +0 -0
  14. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/api/__init__.py +0 -0
  15. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/api/api.py +0 -0
  16. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/__init__.py +0 -0
  17. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/agent_client.py +0 -0
  18. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/agent_service.py +0 -0
  19. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/consumer.py +0 -0
  20. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/document_embeddings_client.py +0 -0
  21. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/document_embeddings_query_service.py +0 -0
  22. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/document_embeddings_store_service.py +0 -0
  23. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/embeddings_client.py +0 -0
  24. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/embeddings_service.py +0 -0
  25. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/flow.py +0 -0
  26. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/graph_embeddings_client.py +0 -0
  27. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/graph_embeddings_query_service.py +0 -0
  28. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/graph_embeddings_store_service.py +0 -0
  29. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/graph_rag_client.py +0 -0
  30. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/llm_service.py +0 -0
  31. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/metrics.py +0 -0
  32. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/producer.py +0 -0
  33. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/producer_spec.py +0 -0
  34. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/prompt_client.py +0 -0
  35. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/pubsub.py +0 -0
  36. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/setting_spec.py +0 -0
  37. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/spec.py +0 -0
  38. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/subscriber_spec.py +0 -0
  39. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/text_completion_client.py +0 -0
  40. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/triples_client.py +0 -0
  41. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/triples_query_service.py +0 -0
  42. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/base/triples_store_service.py +0 -0
  43. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/__init__.py +0 -0
  44. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/agent_client.py +0 -0
  45. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/base.py +0 -0
  46. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/config_client.py +0 -0
  47. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/document_embeddings_client.py +0 -0
  48. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/document_rag_client.py +0 -0
  49. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/embeddings_client.py +0 -0
  50. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/graph_embeddings_client.py +0 -0
  51. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/graph_rag_client.py +0 -0
  52. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/llm_client.py +0 -0
  53. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/prompt_client.py +0 -0
  54. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/clients/triples_query_client.py +0 -0
  55. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/exceptions.py +0 -0
  56. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/knowledge/__init__.py +0 -0
  57. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/knowledge/defs.py +0 -0
  58. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/knowledge/document.py +0 -0
  59. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/knowledge/identifier.py +0 -0
  60. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/knowledge/organization.py +0 -0
  61. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/knowledge/publication.py +0 -0
  62. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/log_level.py +0 -0
  63. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/objects/__init__.py +0 -0
  64. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/objects/field.py +0 -0
  65. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/objects/object.py +0 -0
  66. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/rdf.py +0 -0
  67. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/__init__.py +0 -0
  68. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/agent.py +0 -0
  69. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/config.py +0 -0
  70. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/documents.py +0 -0
  71. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/flows.py +0 -0
  72. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/graph.py +0 -0
  73. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/library.py +0 -0
  74. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/lookup.py +0 -0
  75. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/metadata.py +0 -0
  76. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/models.py +0 -0
  77. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/object.py +0 -0
  78. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/prompt.py +0 -0
  79. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/retrieval.py +0 -0
  80. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/topic.py +0 -0
  81. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph/schema/types.py +0 -0
  82. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph_base.egg-info/SOURCES.txt +0 -0
  83. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph_base.egg-info/dependency_links.txt +0 -0
  84. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph_base.egg-info/requires.txt +0 -0
  85. {trustgraph-base-0.23.2 → trustgraph-base-0.23.4}/trustgraph_base.egg-info/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-base
3
- Version: 0.23.2
3
+ Version: 0.23.4
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
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.2.tar.gz
6
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.4.tar.gz
7
7
  Author: trustgraph.ai
8
8
  Author-email: security@trustgraph.ai
9
9
  Classifier: Programming Language :: Python :: 3
@@ -114,7 +114,7 @@ class AsyncProcessor:
114
114
  version = message.value().version
115
115
 
116
116
  # Invoke message handlers
117
- print("Config change event", config, version, flush=True)
117
+ print("Config change event", version, flush=True)
118
118
  for ch in self.config_handlers:
119
119
  await ch(config, version)
120
120
 
@@ -20,7 +20,7 @@ class ConsumerSpec(Spec):
20
20
  flow = flow,
21
21
  client = processor.pulsar_client,
22
22
  topic = definition[self.name],
23
- subscriber = processor.id + "--" + self.name,
23
+ subscriber = processor.id + "--" + flow.name + "--" + self.name,
24
24
  schema = self.schema,
25
25
  handler = self.handler,
26
26
  metrics = consumer_metrics,
@@ -75,7 +75,8 @@ class FlowProcessor(AsyncProcessor):
75
75
  # Get list of flows which should be running and are currently
76
76
  # running
77
77
  wanted_flows = flow_config.keys()
78
- current_flows = self.flows.keys()
78
+ # This takes a copy, needed because dict gets modified by stop_flow
79
+ current_flows = list(self.flows.keys())
79
80
 
80
81
  # Start all the flows which arent currently running
81
82
  for flow in wanted_flows:
@@ -21,6 +21,7 @@ class Publisher:
21
21
 
22
22
  async def stop(self):
23
23
  self.running = False
24
+ await self.task
24
25
 
25
26
  async def join(self):
26
27
  await self.stop()
@@ -42,7 +43,7 @@ class Publisher:
42
43
  try:
43
44
  id, item = await asyncio.wait_for(
44
45
  self.q.get(),
45
- timeout=0.5
46
+ timeout=0.25
46
47
  )
47
48
  except asyncio.TimeoutError:
48
49
  continue
@@ -57,8 +58,11 @@ class Publisher:
57
58
  except Exception as e:
58
59
  print("Exception:", e, flush=True)
59
60
 
61
+ if not self.running:
62
+ return
63
+
60
64
  # If handler drops out, sleep a retry
61
- time.sleep(2)
65
+ await asyncio.sleep(1)
62
66
 
63
67
  async def send(self, id, item):
64
68
  await self.q.put((id, item))
@@ -127,7 +127,9 @@ class RequestResponseSpec(Spec):
127
127
 
128
128
  rr = self.impl(
129
129
  client = processor.pulsar_client,
130
- subscription = flow.id,
130
+ subscription = (
131
+ processor.id + "--" + flow.name + "--" + self.request_name
132
+ ),
131
133
  consumer_name = flow.id,
132
134
  request_topic = definition[self.request_name],
133
135
  request_schema = self.request_schema,
@@ -20,7 +20,7 @@ class Subscriber:
20
20
  self.running = True
21
21
  self.metrics = metrics
22
22
 
23
- async def __del__(self):
23
+ def __del__(self):
24
24
  self.running = False
25
25
 
26
26
  async def start(self):
@@ -28,6 +28,7 @@ class Subscriber:
28
28
 
29
29
  async def stop(self):
30
30
  self.running = False
31
+ await self.task
31
32
 
32
33
  async def join(self):
33
34
  await self.stop()
@@ -35,6 +36,8 @@ class Subscriber:
35
36
 
36
37
  async def run(self):
37
38
 
39
+ consumer = None
40
+
38
41
  while self.running:
39
42
 
40
43
  if self.metrics:
@@ -59,7 +62,7 @@ class Subscriber:
59
62
  try:
60
63
  msg = await asyncio.to_thread(
61
64
  consumer.receive,
62
- timeout_millis=2000
65
+ timeout_millis=250
63
66
  )
64
67
  except _pulsar.Timeout:
65
68
  continue
@@ -91,7 +94,7 @@ class Subscriber:
91
94
  # FIXME: Timeout means data goes missing
92
95
  await asyncio.wait_for(
93
96
  self.q[id].put(value),
94
- timeout=2
97
+ timeout=1
95
98
  )
96
99
 
97
100
  except Exception as e:
@@ -103,7 +106,7 @@ class Subscriber:
103
106
  # FIXME: Timeout means data goes missing
104
107
  await asyncio.wait_for(
105
108
  q.put(value),
106
- timeout=2
109
+ timeout=1
107
110
  )
108
111
  except Exception as e:
109
112
  self.metrics.dropped()
@@ -112,13 +115,21 @@ class Subscriber:
112
115
  except Exception as e:
113
116
  print("Subscriber exception:", e, flush=True)
114
117
 
115
- consumer.close()
118
+ finally:
119
+
120
+ if consumer:
121
+ consumer.close()
122
+ consumer = None
123
+
116
124
 
117
125
  if self.metrics:
118
126
  self.metrics.state("stopped")
119
127
 
128
+ if not self.running:
129
+ return
130
+
120
131
  # If handler drops out, sleep a retry
121
- time.sleep(2)
132
+ await asyncio.sleep(1)
122
133
 
123
134
  async def subscribe(self, id):
124
135
 
@@ -0,0 +1 @@
1
+ __version__ = "0.23.4"
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-base
3
- Version: 0.23.2
3
+ Version: 0.23.4
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
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.2.tar.gz
6
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.4.tar.gz
7
7
  Author: trustgraph.ai
8
8
  Author-email: security@trustgraph.ai
9
9
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- __version__ = "0.23.2"