trustgraph-base 0.21.1__tar.gz → 0.21.3__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.21.1 → trustgraph-base-0.21.3}/PKG-INFO +2 -2
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/base_processor.py +19 -2
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/publisher.py +4 -10
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/subscriber.py +4 -10
- trustgraph-base-0.21.3/trustgraph/base_version.py +1 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/agent_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/base.py +11 -2
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/document_embeddings_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/document_rag_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/embeddings_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/graph_embeddings_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/graph_rag_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/llm_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/prompt_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/triples_query_client.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/library.py +2 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph_base.egg-info/PKG-INFO +2 -2
- trustgraph-base-0.21.1/trustgraph/base_version.py +0 -1
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/README.md +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/setup.cfg +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/setup.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/api/__init__.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/api/api.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/__init__.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/consumer.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/consumer_producer.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/base/producer.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/__init__.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/exceptions.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/knowledge/__init__.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/knowledge/defs.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/knowledge/document.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/knowledge/identifier.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/knowledge/organization.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/knowledge/publication.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/log_level.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/objects/__init__.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/objects/field.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/objects/object.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/rdf.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/__init__.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/agent.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/documents.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/graph.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/lookup.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/metadata.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/models.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/object.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/prompt.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/retrieval.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/topic.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/schema/types.py +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph_base.egg-info/SOURCES.txt +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph_base.egg-info/dependency_links.txt +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph_base.egg-info/requires.txt +0 -0
- {trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/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.21.
|
3
|
+
Version: 0.21.3
|
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.21.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.21.3.tar.gz
|
7
7
|
Author: trustgraph.ai
|
8
8
|
Author-email: security@trustgraph.ai
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
@@ -12,6 +12,7 @@ from .. log_level import LogLevel
|
|
12
12
|
class BaseProcessor:
|
13
13
|
|
14
14
|
default_pulsar_host = os.getenv("PULSAR_HOST", 'pulsar://pulsar:6650')
|
15
|
+
default_pulsar_api_key = os.getenv("PULSAR_API_KEY", None)
|
15
16
|
|
16
17
|
def __init__(self, **params):
|
17
18
|
|
@@ -30,15 +31,25 @@ class BaseProcessor:
|
|
30
31
|
|
31
32
|
pulsar_host = params.get("pulsar_host", self.default_pulsar_host)
|
32
33
|
pulsar_listener = params.get("pulsar_listener", None)
|
34
|
+
pulsar_api_key = params.get("pulsar_api_key", None)
|
33
35
|
log_level = params.get("log_level", LogLevel.INFO)
|
34
36
|
|
35
37
|
self.pulsar_host = pulsar_host
|
38
|
+
self.pulsar_api_key = pulsar_api_key
|
36
39
|
|
37
|
-
|
40
|
+
if pulsar_api_key:
|
41
|
+
auth = pulsar.AuthenticationToken(pulsar_api_key)
|
42
|
+
self.client = pulsar.Client(
|
43
|
+
pulsar_host,
|
44
|
+
authentication=auth,
|
45
|
+
logger=pulsar.ConsoleLogger(log_level.to_pulsar())
|
46
|
+
)
|
47
|
+
else:
|
48
|
+
self.client = pulsar.Client(
|
38
49
|
pulsar_host,
|
39
50
|
listener_name=pulsar_listener,
|
40
51
|
logger=pulsar.ConsoleLogger(log_level.to_pulsar())
|
41
|
-
|
52
|
+
)
|
42
53
|
|
43
54
|
self.pulsar_listener = pulsar_listener
|
44
55
|
|
@@ -56,6 +67,12 @@ class BaseProcessor:
|
|
56
67
|
default=__class__.default_pulsar_host,
|
57
68
|
help=f'Pulsar host (default: {__class__.default_pulsar_host})',
|
58
69
|
)
|
70
|
+
|
71
|
+
parser.add_argument(
|
72
|
+
'--pulsar-api-key',
|
73
|
+
default=__class__.default_pulsar_api_key,
|
74
|
+
help=f'Pulsar API key',
|
75
|
+
)
|
59
76
|
|
60
77
|
parser.add_argument(
|
61
78
|
'--pulsar-listener',
|
@@ -6,14 +6,13 @@ import threading
|
|
6
6
|
|
7
7
|
class Publisher:
|
8
8
|
|
9
|
-
def __init__(self,
|
10
|
-
chunking_enabled=True
|
11
|
-
self.
|
9
|
+
def __init__(self, pulsar_client, topic, schema=None, max_size=10,
|
10
|
+
chunking_enabled=True):
|
11
|
+
self.client = pulsar_client
|
12
12
|
self.topic = topic
|
13
13
|
self.schema = schema
|
14
14
|
self.q = queue.Queue(maxsize=max_size)
|
15
15
|
self.chunking_enabled = chunking_enabled
|
16
|
-
self.listener_name = listener
|
17
16
|
self.running = True
|
18
17
|
|
19
18
|
def start(self):
|
@@ -32,12 +31,7 @@ class Publisher:
|
|
32
31
|
while self.running:
|
33
32
|
|
34
33
|
try:
|
35
|
-
|
36
|
-
client = pulsar.Client(
|
37
|
-
self.pulsar_host, listener_name=self.listener_name
|
38
|
-
)
|
39
|
-
|
40
|
-
producer = client.create_producer(
|
34
|
+
producer = self.client.create_producer(
|
41
35
|
topic=self.topic,
|
42
36
|
schema=self.schema,
|
43
37
|
chunking_enabled=self.chunking_enabled,
|
@@ -6,9 +6,9 @@ import time
|
|
6
6
|
|
7
7
|
class Subscriber:
|
8
8
|
|
9
|
-
def __init__(self,
|
10
|
-
schema=None, max_size=100
|
11
|
-
self.
|
9
|
+
def __init__(self, pulsar_client, topic, subscription, consumer_name,
|
10
|
+
schema=None, max_size=100):
|
11
|
+
self.client = pulsar_client
|
12
12
|
self.topic = topic
|
13
13
|
self.subscription = subscription
|
14
14
|
self.consumer_name = consumer_name
|
@@ -17,7 +17,6 @@ class Subscriber:
|
|
17
17
|
self.full = {}
|
18
18
|
self.max_size = max_size
|
19
19
|
self.lock = threading.Lock()
|
20
|
-
self.listener_name = listener
|
21
20
|
self.running = True
|
22
21
|
|
23
22
|
def start(self):
|
@@ -36,12 +35,7 @@ class Subscriber:
|
|
36
35
|
|
37
36
|
try:
|
38
37
|
|
39
|
-
|
40
|
-
self.pulsar_host,
|
41
|
-
listener_name=self.listener_name,
|
42
|
-
)
|
43
|
-
|
44
|
-
consumer = client.subscribe(
|
38
|
+
consumer = self.client.subscribe(
|
45
39
|
topic=self.topic,
|
46
40
|
subscription_name=self.subscription,
|
47
41
|
consumer_name=self.consumer_name,
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.21.3"
|
@@ -20,6 +20,7 @@ class AgentClient(BaseClient):
|
|
20
20
|
input_queue=None,
|
21
21
|
output_queue=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue is None: input_queue = agent_request_queue
|
@@ -33,6 +34,7 @@ class AgentClient(BaseClient):
|
|
33
34
|
pulsar_host=pulsar_host,
|
34
35
|
input_schema=AgentRequest,
|
35
36
|
output_schema=AgentResponse,
|
37
|
+
pulsar_api_key=pulsar_api_key
|
36
38
|
)
|
37
39
|
|
38
40
|
def request(
|
@@ -27,6 +27,7 @@ class BaseClient:
|
|
27
27
|
input_schema=None,
|
28
28
|
output_schema=None,
|
29
29
|
pulsar_host="pulsar://pulsar:6650",
|
30
|
+
pulsar_api_key=None,
|
30
31
|
):
|
31
32
|
|
32
33
|
if input_queue == None: raise RuntimeError("Need input_queue")
|
@@ -37,10 +38,18 @@ class BaseClient:
|
|
37
38
|
if subscriber == None:
|
38
39
|
subscriber = str(uuid.uuid4())
|
39
40
|
|
40
|
-
|
41
|
+
if pulsar_api_key:
|
42
|
+
auth = pulsar.AuthenticationToken(pulsar_api_key)
|
43
|
+
self.client = pulsar.Client(
|
41
44
|
pulsar_host,
|
42
45
|
logger=pulsar.ConsoleLogger(log_level),
|
43
|
-
|
46
|
+
authentication=auth,
|
47
|
+
)
|
48
|
+
else:
|
49
|
+
self.client = pulsar.Client(
|
50
|
+
pulsar_host,
|
51
|
+
logger=pulsar.ConsoleLogger(log_level)
|
52
|
+
)
|
44
53
|
|
45
54
|
self.producer = self.client.create_producer(
|
46
55
|
topic=input_queue,
|
{trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/document_embeddings_client.py
RENAMED
@@ -20,6 +20,7 @@ class DocumentEmbeddingsClient(BaseClient):
|
|
20
20
|
input_queue=None,
|
21
21
|
output_queue=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue == None:
|
@@ -34,6 +35,7 @@ class DocumentEmbeddingsClient(BaseClient):
|
|
34
35
|
input_queue=input_queue,
|
35
36
|
output_queue=output_queue,
|
36
37
|
pulsar_host=pulsar_host,
|
38
|
+
pulsar_api_key=pulsar_api_key,
|
37
39
|
input_schema=DocumentEmbeddingsRequest,
|
38
40
|
output_schema=DocumentEmbeddingsResponse,
|
39
41
|
)
|
@@ -20,6 +20,7 @@ class DocumentRagClient(BaseClient):
|
|
20
20
|
input_queue=None,
|
21
21
|
output_queue=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue == None:
|
@@ -34,6 +35,7 @@ class DocumentRagClient(BaseClient):
|
|
34
35
|
input_queue=input_queue,
|
35
36
|
output_queue=output_queue,
|
36
37
|
pulsar_host=pulsar_host,
|
38
|
+
pulsar_api_key=pulsar_api_key,
|
37
39
|
input_schema=DocumentRagQuery,
|
38
40
|
output_schema=DocumentRagResponse,
|
39
41
|
)
|
@@ -20,6 +20,7 @@ class EmbeddingsClient(BaseClient):
|
|
20
20
|
output_queue=None,
|
21
21
|
subscriber=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue == None:
|
@@ -34,6 +35,7 @@ class EmbeddingsClient(BaseClient):
|
|
34
35
|
input_queue=input_queue,
|
35
36
|
output_queue=output_queue,
|
36
37
|
pulsar_host=pulsar_host,
|
38
|
+
pulsar_api_key=pulsar_api_key,
|
37
39
|
input_schema=EmbeddingsRequest,
|
38
40
|
output_schema=EmbeddingsResponse,
|
39
41
|
)
|
{trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/graph_embeddings_client.py
RENAMED
@@ -20,6 +20,7 @@ class GraphEmbeddingsClient(BaseClient):
|
|
20
20
|
input_queue=None,
|
21
21
|
output_queue=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue == None:
|
@@ -34,6 +35,7 @@ class GraphEmbeddingsClient(BaseClient):
|
|
34
35
|
input_queue=input_queue,
|
35
36
|
output_queue=output_queue,
|
36
37
|
pulsar_host=pulsar_host,
|
38
|
+
pulsar_api_key=pulsar_api_key,
|
37
39
|
input_schema=GraphEmbeddingsRequest,
|
38
40
|
output_schema=GraphEmbeddingsResponse,
|
39
41
|
)
|
@@ -20,6 +20,7 @@ class GraphRagClient(BaseClient):
|
|
20
20
|
input_queue=None,
|
21
21
|
output_queue=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue == None:
|
@@ -34,6 +35,7 @@ class GraphRagClient(BaseClient):
|
|
34
35
|
input_queue=input_queue,
|
35
36
|
output_queue=output_queue,
|
36
37
|
pulsar_host=pulsar_host,
|
38
|
+
pulsar_api_key=pulsar_api_key,
|
37
39
|
input_schema=GraphRagQuery,
|
38
40
|
output_schema=GraphRagResponse,
|
39
41
|
)
|
@@ -20,6 +20,7 @@ class LlmClient(BaseClient):
|
|
20
20
|
input_queue=None,
|
21
21
|
output_queue=None,
|
22
22
|
pulsar_host="pulsar://pulsar:6650",
|
23
|
+
pulsar_api_key=None,
|
23
24
|
):
|
24
25
|
|
25
26
|
if input_queue is None: input_queue = text_completion_request_queue
|
@@ -31,6 +32,7 @@ class LlmClient(BaseClient):
|
|
31
32
|
input_queue=input_queue,
|
32
33
|
output_queue=output_queue,
|
33
34
|
pulsar_host=pulsar_host,
|
35
|
+
pulsar_api_key=pulsar_api_key,
|
34
36
|
input_schema=TextCompletionRequest,
|
35
37
|
output_schema=TextCompletionResponse,
|
36
38
|
)
|
@@ -39,6 +39,7 @@ class PromptClient(BaseClient):
|
|
39
39
|
input_queue=None,
|
40
40
|
output_queue=None,
|
41
41
|
pulsar_host="pulsar://pulsar:6650",
|
42
|
+
pulsar_api_key=None,
|
42
43
|
):
|
43
44
|
|
44
45
|
if input_queue == None:
|
@@ -53,6 +54,7 @@ class PromptClient(BaseClient):
|
|
53
54
|
input_queue=input_queue,
|
54
55
|
output_queue=output_queue,
|
55
56
|
pulsar_host=pulsar_host,
|
57
|
+
pulsar_api_key=pulsar_api_key,
|
56
58
|
input_schema=PromptRequest,
|
57
59
|
output_schema=PromptResponse,
|
58
60
|
)
|
{trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph/clients/triples_query_client.py
RENAMED
@@ -21,6 +21,7 @@ class TriplesQueryClient(BaseClient):
|
|
21
21
|
input_queue=None,
|
22
22
|
output_queue=None,
|
23
23
|
pulsar_host="pulsar://pulsar:6650",
|
24
|
+
pulsar_api_key=None,
|
24
25
|
):
|
25
26
|
|
26
27
|
if input_queue == None:
|
@@ -34,6 +35,7 @@ class TriplesQueryClient(BaseClient):
|
|
34
35
|
subscriber=subscriber,
|
35
36
|
input_queue=input_queue,
|
36
37
|
output_queue=output_queue,
|
38
|
+
pulsar_api_key=pulsar_api_key,
|
37
39
|
pulsar_host=pulsar_host,
|
38
40
|
input_schema=TriplesQueryRequest,
|
39
41
|
output_schema=TriplesQueryResponse,
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: trustgraph-base
|
3
|
-
Version: 0.21.
|
3
|
+
Version: 0.21.3
|
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.21.
|
6
|
+
Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.21.3.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.21.1"
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph-base-0.21.1 → trustgraph-base-0.21.3}/trustgraph_base.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|