trustgraph-base 0.23.3__tar.gz → 0.23.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.
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/PKG-INFO +2 -2
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/publisher.py +12 -3
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/subscriber.py +24 -6
- trustgraph-base-0.23.5/trustgraph/base_version.py +1 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/embeddings_client.py +0 -8
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph_base.egg-info/PKG-INFO +2 -2
- trustgraph-base-0.23.3/trustgraph/base_version.py +0 -1
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/README.md +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/setup.cfg +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/setup.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/api/__init__.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/api/api.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/__init__.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/agent_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/agent_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/async_processor.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/consumer.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/consumer_spec.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/document_embeddings_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/document_embeddings_query_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/document_embeddings_store_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/embeddings_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/embeddings_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/flow.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/flow_processor.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_embeddings_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_embeddings_query_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_embeddings_store_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_rag_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/llm_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/metrics.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/producer.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/producer_spec.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/prompt_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/pubsub.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/request_response_spec.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/setting_spec.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/spec.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/subscriber_spec.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/text_completion_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/triples_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/triples_query_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/triples_store_service.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/__init__.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/agent_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/base.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/config_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/document_embeddings_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/document_rag_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/graph_embeddings_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/graph_rag_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/llm_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/prompt_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/triples_query_client.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/exceptions.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/knowledge/__init__.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/knowledge/defs.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/knowledge/document.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/knowledge/identifier.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/knowledge/organization.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/knowledge/publication.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/log_level.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/objects/__init__.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/objects/field.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/objects/object.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/rdf.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/__init__.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/agent.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/config.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/documents.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/flows.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/graph.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/library.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/lookup.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/metadata.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/models.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/object.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/prompt.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/retrieval.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/topic.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/schema/types.py +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph_base.egg-info/SOURCES.txt +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph_base.egg-info/dependency_links.txt +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph_base.egg-info/requires.txt +0 -0
- {trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/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.
|
3
|
+
Version: 0.23.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
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.5.tar.gz
|
7
7
|
Author: trustgraph.ai
|
8
8
|
Author-email: security@trustgraph.ai
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -15,6 +15,7 @@ class Publisher:
|
|
15
15
|
self.q = asyncio.Queue(maxsize=max_size)
|
16
16
|
self.chunking_enabled = chunking_enabled
|
17
17
|
self.running = True
|
18
|
+
self.task = None
|
18
19
|
|
19
20
|
async def start(self):
|
20
21
|
self.task = asyncio.create_task(self.run())
|
@@ -22,9 +23,14 @@ class Publisher:
|
|
22
23
|
async def stop(self):
|
23
24
|
self.running = False
|
24
25
|
|
26
|
+
if self.task:
|
27
|
+
await self.task
|
28
|
+
|
25
29
|
async def join(self):
|
26
30
|
await self.stop()
|
27
|
-
|
31
|
+
|
32
|
+
if self.task:
|
33
|
+
await self.task
|
28
34
|
|
29
35
|
async def run(self):
|
30
36
|
|
@@ -42,7 +48,7 @@ class Publisher:
|
|
42
48
|
try:
|
43
49
|
id, item = await asyncio.wait_for(
|
44
50
|
self.q.get(),
|
45
|
-
timeout=0.
|
51
|
+
timeout=0.25
|
46
52
|
)
|
47
53
|
except asyncio.TimeoutError:
|
48
54
|
continue
|
@@ -57,8 +63,11 @@ class Publisher:
|
|
57
63
|
except Exception as e:
|
58
64
|
print("Exception:", e, flush=True)
|
59
65
|
|
66
|
+
if not self.running:
|
67
|
+
return
|
68
|
+
|
60
69
|
# If handler drops out, sleep a retry
|
61
|
-
|
70
|
+
await asyncio.sleep(1)
|
62
71
|
|
63
72
|
async def send(self, id, item):
|
64
73
|
await self.q.put((id, item))
|
@@ -19,6 +19,7 @@ class Subscriber:
|
|
19
19
|
self.lock = asyncio.Lock()
|
20
20
|
self.running = True
|
21
21
|
self.metrics = metrics
|
22
|
+
self.task = None
|
22
23
|
|
23
24
|
def __del__(self):
|
24
25
|
self.running = False
|
@@ -29,12 +30,19 @@ class Subscriber:
|
|
29
30
|
async def stop(self):
|
30
31
|
self.running = False
|
31
32
|
|
33
|
+
if self.task:
|
34
|
+
await self.task
|
35
|
+
|
32
36
|
async def join(self):
|
33
37
|
await self.stop()
|
34
|
-
|
38
|
+
|
39
|
+
if self.task:
|
40
|
+
await self.task
|
35
41
|
|
36
42
|
async def run(self):
|
37
43
|
|
44
|
+
consumer = None
|
45
|
+
|
38
46
|
while self.running:
|
39
47
|
|
40
48
|
if self.metrics:
|
@@ -42,6 +50,8 @@ class Subscriber:
|
|
42
50
|
|
43
51
|
try:
|
44
52
|
|
53
|
+
# FIXME: Create consumer in start method so we know
|
54
|
+
# it is definitely running when start completes
|
45
55
|
consumer = self.client.subscribe(
|
46
56
|
topic = self.topic,
|
47
57
|
subscription_name = self.subscription,
|
@@ -59,7 +69,7 @@ class Subscriber:
|
|
59
69
|
try:
|
60
70
|
msg = await asyncio.to_thread(
|
61
71
|
consumer.receive,
|
62
|
-
timeout_millis=
|
72
|
+
timeout_millis=250
|
63
73
|
)
|
64
74
|
except _pulsar.Timeout:
|
65
75
|
continue
|
@@ -91,7 +101,7 @@ class Subscriber:
|
|
91
101
|
# FIXME: Timeout means data goes missing
|
92
102
|
await asyncio.wait_for(
|
93
103
|
self.q[id].put(value),
|
94
|
-
timeout=
|
104
|
+
timeout=1
|
95
105
|
)
|
96
106
|
|
97
107
|
except Exception as e:
|
@@ -103,7 +113,7 @@ class Subscriber:
|
|
103
113
|
# FIXME: Timeout means data goes missing
|
104
114
|
await asyncio.wait_for(
|
105
115
|
q.put(value),
|
106
|
-
timeout=
|
116
|
+
timeout=1
|
107
117
|
)
|
108
118
|
except Exception as e:
|
109
119
|
self.metrics.dropped()
|
@@ -112,13 +122,21 @@ class Subscriber:
|
|
112
122
|
except Exception as e:
|
113
123
|
print("Subscriber exception:", e, flush=True)
|
114
124
|
|
115
|
-
|
125
|
+
finally:
|
126
|
+
|
127
|
+
if consumer:
|
128
|
+
consumer.close()
|
129
|
+
consumer = None
|
130
|
+
|
116
131
|
|
117
132
|
if self.metrics:
|
118
133
|
self.metrics.state("stopped")
|
119
134
|
|
135
|
+
if not self.running:
|
136
|
+
return
|
137
|
+
|
120
138
|
# If handler drops out, sleep a retry
|
121
|
-
|
139
|
+
await asyncio.sleep(1)
|
122
140
|
|
123
141
|
async def subscribe(self, id):
|
124
142
|
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.23.5"
|
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
2
|
from pulsar.schema import JsonSchema
|
3
3
|
from .. schema import EmbeddingsRequest, EmbeddingsResponse
|
4
|
-
from .. schema import embeddings_request_queue, embeddings_response_queue
|
5
4
|
from . base import BaseClient
|
6
5
|
|
7
6
|
import _pulsar
|
@@ -23,12 +22,6 @@ class EmbeddingsClient(BaseClient):
|
|
23
22
|
pulsar_api_key=None,
|
24
23
|
):
|
25
24
|
|
26
|
-
if input_queue == None:
|
27
|
-
input_queue=embeddings_request_queue
|
28
|
-
|
29
|
-
if output_queue == None:
|
30
|
-
output_queue=embeddings_response_queue
|
31
|
-
|
32
25
|
super(EmbeddingsClient, self).__init__(
|
33
26
|
log_level=log_level,
|
34
27
|
subscriber=subscriber,
|
@@ -43,4 +36,3 @@ class EmbeddingsClient(BaseClient):
|
|
43
36
|
def request(self, text, timeout=300):
|
44
37
|
return self.call(text=text, timeout=timeout).vectors
|
45
38
|
|
46
|
-
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-base
|
3
|
-
Version: 0.23.
|
3
|
+
Version: 0.23.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
|
-
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.23.5.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.3"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/document_embeddings_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_embeddings_client.py
RENAMED
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_embeddings_query_service.py
RENAMED
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/base/graph_embeddings_store_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/document_embeddings_client.py
RENAMED
File without changes
|
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/graph_embeddings_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph/clients/triples_query_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph-base-0.23.3 → trustgraph-base-0.23.5}/trustgraph_base.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|