trustgraph-base 1.3.2__tar.gz → 1.3.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.
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/PKG-INFO +1 -1
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/flow.py +43 -0
- trustgraph_base-1.3.4/trustgraph/base/cassandra_config.py +134 -0
- trustgraph_base-1.3.4/trustgraph/base_version.py +1 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/__init__.py +7 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/__init__.py +1 -0
- trustgraph_base-1.3.4/trustgraph/messaging/translators/objects_query.py +79 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/__init__.py +2 -1
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/agent.py +1 -1
- trustgraph_base-1.3.4/trustgraph/schema/services/objects_query.py +28 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph_base.egg-info/PKG-INFO +1 -1
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph_base.egg-info/SOURCES.txt +3 -0
- trustgraph_base-1.3.2/trustgraph/base_version.py +0 -1
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/README.md +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/pyproject.toml +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/setup.cfg +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/api.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/config.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/exceptions.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/knowledge.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/library.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/api/types.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/agent_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/agent_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/async_processor.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/consumer.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/consumer_spec.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/document_embeddings_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/document_embeddings_query_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/document_embeddings_store_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/embeddings_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/embeddings_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/flow.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/flow_processor.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/graph_embeddings_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/graph_embeddings_query_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/graph_embeddings_store_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/graph_rag_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/llm_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/metrics.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/producer.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/producer_spec.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/prompt_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/publisher.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/pubsub.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/request_response_spec.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/setting_spec.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/spec.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/subscriber.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/subscriber_spec.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/text_completion_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/tool_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/tool_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/triples_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/triples_query_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/triples_store_service.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/agent_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/base.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/config_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/document_embeddings_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/document_rag_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/embeddings_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/graph_embeddings_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/graph_rag_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/llm_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/prompt_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/triples_query_client.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/exceptions.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/knowledge/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/knowledge/defs.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/knowledge/document.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/knowledge/identifier.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/knowledge/organization.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/knowledge/publication.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/log_level.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/registry.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/agent.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/base.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/config.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/document_loading.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/embeddings.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/embeddings_query.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/flow.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/knowledge.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/library.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/metadata.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/primitives.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/prompt.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/retrieval.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/text_completion.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/tool.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/triples.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/objects/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/objects/field.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/objects/object.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/rdf.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/core/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/core/metadata.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/core/primitives.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/core/topic.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/__init__.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/document.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/embeddings.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/graph.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/knowledge.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/nlp.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/object.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/rows.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/knowledge/structured.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/config.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/flow.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/library.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/llm.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/lookup.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/nlp_query.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/prompt.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/query.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/retrieval.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/structured_query.py +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph_base.egg-info/dependency_links.txt +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph_base.egg-info/requires.txt +0 -0
- {trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph_base.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: trustgraph-base
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.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
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
@@ -383,3 +383,46 @@ class FlowInstance:
|
|
383
383
|
input
|
384
384
|
)
|
385
385
|
|
386
|
+
def objects_query(
|
387
|
+
self, query, user="trustgraph", collection="default",
|
388
|
+
variables=None, operation_name=None
|
389
|
+
):
|
390
|
+
|
391
|
+
# The input consists of a GraphQL query and optional variables
|
392
|
+
input = {
|
393
|
+
"query": query,
|
394
|
+
"user": user,
|
395
|
+
"collection": collection,
|
396
|
+
}
|
397
|
+
|
398
|
+
if variables:
|
399
|
+
input["variables"] = variables
|
400
|
+
|
401
|
+
if operation_name:
|
402
|
+
input["operation_name"] = operation_name
|
403
|
+
|
404
|
+
response = self.request(
|
405
|
+
"service/objects",
|
406
|
+
input
|
407
|
+
)
|
408
|
+
|
409
|
+
# Check for system-level error
|
410
|
+
if "error" in response and response["error"]:
|
411
|
+
error_type = response["error"].get("type", "unknown")
|
412
|
+
error_message = response["error"].get("message", "Unknown error")
|
413
|
+
raise ProtocolException(f"{error_type}: {error_message}")
|
414
|
+
|
415
|
+
# Return the GraphQL response structure
|
416
|
+
result = {}
|
417
|
+
|
418
|
+
if "data" in response:
|
419
|
+
result["data"] = response["data"]
|
420
|
+
|
421
|
+
if "errors" in response and response["errors"]:
|
422
|
+
result["errors"] = response["errors"]
|
423
|
+
|
424
|
+
if "extensions" in response and response["extensions"]:
|
425
|
+
result["extensions"] = response["extensions"]
|
426
|
+
|
427
|
+
return result
|
428
|
+
|
@@ -0,0 +1,134 @@
|
|
1
|
+
"""
|
2
|
+
Cassandra configuration utilities for standardized parameter handling.
|
3
|
+
|
4
|
+
Provides consistent Cassandra configuration across all TrustGraph processors,
|
5
|
+
including command-line arguments, environment variables, and defaults.
|
6
|
+
"""
|
7
|
+
|
8
|
+
import os
|
9
|
+
import argparse
|
10
|
+
from typing import Optional, Tuple, List, Any
|
11
|
+
|
12
|
+
|
13
|
+
def get_cassandra_defaults() -> dict:
|
14
|
+
"""
|
15
|
+
Get default Cassandra configuration values from environment variables or fallback defaults.
|
16
|
+
|
17
|
+
Returns:
|
18
|
+
dict: Dictionary with 'host', 'username', and 'password' keys
|
19
|
+
"""
|
20
|
+
return {
|
21
|
+
'host': os.getenv('CASSANDRA_HOST', 'cassandra'),
|
22
|
+
'username': os.getenv('CASSANDRA_USERNAME'),
|
23
|
+
'password': os.getenv('CASSANDRA_PASSWORD')
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
def add_cassandra_args(parser: argparse.ArgumentParser) -> None:
|
28
|
+
"""
|
29
|
+
Add standardized Cassandra configuration arguments to an argument parser.
|
30
|
+
|
31
|
+
Shows environment variable values in help text when they are set.
|
32
|
+
Password values are never displayed for security.
|
33
|
+
|
34
|
+
Args:
|
35
|
+
parser: ArgumentParser instance to add arguments to
|
36
|
+
"""
|
37
|
+
defaults = get_cassandra_defaults()
|
38
|
+
|
39
|
+
# Format help text with environment variable indication
|
40
|
+
host_help = f"Cassandra host list, comma-separated (default: {defaults['host']})"
|
41
|
+
if 'CASSANDRA_HOST' in os.environ:
|
42
|
+
host_help += " [from CASSANDRA_HOST]"
|
43
|
+
|
44
|
+
username_help = "Cassandra username"
|
45
|
+
if defaults['username']:
|
46
|
+
username_help += f" (default: {defaults['username']})"
|
47
|
+
if 'CASSANDRA_USERNAME' in os.environ:
|
48
|
+
username_help += " [from CASSANDRA_USERNAME]"
|
49
|
+
|
50
|
+
password_help = "Cassandra password"
|
51
|
+
if defaults['password']:
|
52
|
+
# Never show actual password value
|
53
|
+
password_help += " (default: <set>)"
|
54
|
+
if 'CASSANDRA_PASSWORD' in os.environ:
|
55
|
+
password_help += " [from CASSANDRA_PASSWORD]"
|
56
|
+
|
57
|
+
parser.add_argument(
|
58
|
+
'--cassandra-host',
|
59
|
+
default=defaults['host'],
|
60
|
+
help=host_help
|
61
|
+
)
|
62
|
+
|
63
|
+
parser.add_argument(
|
64
|
+
'--cassandra-username',
|
65
|
+
default=defaults['username'],
|
66
|
+
help=username_help
|
67
|
+
)
|
68
|
+
|
69
|
+
parser.add_argument(
|
70
|
+
'--cassandra-password',
|
71
|
+
default=defaults['password'],
|
72
|
+
help=password_help
|
73
|
+
)
|
74
|
+
|
75
|
+
|
76
|
+
def resolve_cassandra_config(
|
77
|
+
args: Optional[Any] = None,
|
78
|
+
host: Optional[str] = None,
|
79
|
+
username: Optional[str] = None,
|
80
|
+
password: Optional[str] = None
|
81
|
+
) -> Tuple[List[str], Optional[str], Optional[str]]:
|
82
|
+
"""
|
83
|
+
Resolve Cassandra configuration from various sources.
|
84
|
+
|
85
|
+
Can accept either argparse args object or explicit parameters.
|
86
|
+
Converts host string to list format for Cassandra driver.
|
87
|
+
|
88
|
+
Args:
|
89
|
+
args: Optional argparse namespace with cassandra_host, cassandra_username, cassandra_password
|
90
|
+
host: Optional explicit host parameter (overrides args)
|
91
|
+
username: Optional explicit username parameter (overrides args)
|
92
|
+
password: Optional explicit password parameter (overrides args)
|
93
|
+
|
94
|
+
Returns:
|
95
|
+
tuple: (hosts_list, username, password)
|
96
|
+
"""
|
97
|
+
# If args provided, extract values
|
98
|
+
if args is not None:
|
99
|
+
host = host or getattr(args, 'cassandra_host', None)
|
100
|
+
username = username or getattr(args, 'cassandra_username', None)
|
101
|
+
password = password or getattr(args, 'cassandra_password', None)
|
102
|
+
|
103
|
+
# Apply defaults if still None
|
104
|
+
defaults = get_cassandra_defaults()
|
105
|
+
host = host or defaults['host']
|
106
|
+
username = username or defaults['username']
|
107
|
+
password = password or defaults['password']
|
108
|
+
|
109
|
+
# Convert host string to list
|
110
|
+
if isinstance(host, str):
|
111
|
+
hosts = [h.strip() for h in host.split(',') if h.strip()]
|
112
|
+
else:
|
113
|
+
hosts = host
|
114
|
+
|
115
|
+
return hosts, username, password
|
116
|
+
|
117
|
+
|
118
|
+
def get_cassandra_config_from_params(params: dict) -> Tuple[List[str], Optional[str], Optional[str]]:
|
119
|
+
"""
|
120
|
+
Extract and resolve Cassandra configuration from a parameters dictionary.
|
121
|
+
|
122
|
+
Args:
|
123
|
+
params: Dictionary of parameters that may contain Cassandra configuration
|
124
|
+
|
125
|
+
Returns:
|
126
|
+
tuple: (hosts_list, username, password)
|
127
|
+
"""
|
128
|
+
# Get Cassandra parameters
|
129
|
+
host = params.get('cassandra_host')
|
130
|
+
username = params.get('cassandra_username')
|
131
|
+
password = params.get('cassandra_password')
|
132
|
+
|
133
|
+
# Use resolve function to handle defaults and list conversion
|
134
|
+
return resolve_cassandra_config(host=host, username=username, password=password)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "1.3.4"
|
@@ -21,6 +21,7 @@ from .translators.embeddings_query import (
|
|
21
21
|
DocumentEmbeddingsRequestTranslator, DocumentEmbeddingsResponseTranslator,
|
22
22
|
GraphEmbeddingsRequestTranslator, GraphEmbeddingsResponseTranslator
|
23
23
|
)
|
24
|
+
from .translators.objects_query import ObjectsQueryRequestTranslator, ObjectsQueryResponseTranslator
|
24
25
|
|
25
26
|
# Register all service translators
|
26
27
|
TranslatorRegistry.register_service(
|
@@ -107,6 +108,12 @@ TranslatorRegistry.register_service(
|
|
107
108
|
GraphEmbeddingsResponseTranslator()
|
108
109
|
)
|
109
110
|
|
111
|
+
TranslatorRegistry.register_service(
|
112
|
+
"objects-query",
|
113
|
+
ObjectsQueryRequestTranslator(),
|
114
|
+
ObjectsQueryResponseTranslator()
|
115
|
+
)
|
116
|
+
|
110
117
|
# Register single-direction translators for document loading
|
111
118
|
TranslatorRegistry.register_request("document", DocumentTranslator())
|
112
119
|
TranslatorRegistry.register_request("text-document", TextDocumentTranslator())
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/__init__.py
RENAMED
@@ -17,3 +17,4 @@ from .embeddings_query import (
|
|
17
17
|
DocumentEmbeddingsRequestTranslator, DocumentEmbeddingsResponseTranslator,
|
18
18
|
GraphEmbeddingsRequestTranslator, GraphEmbeddingsResponseTranslator
|
19
19
|
)
|
20
|
+
from .objects_query import ObjectsQueryRequestTranslator, ObjectsQueryResponseTranslator
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from typing import Dict, Any, Tuple, Optional
|
2
|
+
from ...schema import ObjectsQueryRequest, ObjectsQueryResponse
|
3
|
+
from .base import MessageTranslator
|
4
|
+
import json
|
5
|
+
|
6
|
+
|
7
|
+
class ObjectsQueryRequestTranslator(MessageTranslator):
|
8
|
+
"""Translator for ObjectsQueryRequest schema objects"""
|
9
|
+
|
10
|
+
def to_pulsar(self, data: Dict[str, Any]) -> ObjectsQueryRequest:
|
11
|
+
return ObjectsQueryRequest(
|
12
|
+
user=data.get("user", "trustgraph"),
|
13
|
+
collection=data.get("collection", "default"),
|
14
|
+
query=data.get("query", ""),
|
15
|
+
variables=data.get("variables", {}),
|
16
|
+
operation_name=data.get("operation_name", None)
|
17
|
+
)
|
18
|
+
|
19
|
+
def from_pulsar(self, obj: ObjectsQueryRequest) -> Dict[str, Any]:
|
20
|
+
result = {
|
21
|
+
"user": obj.user,
|
22
|
+
"collection": obj.collection,
|
23
|
+
"query": obj.query,
|
24
|
+
"variables": dict(obj.variables) if obj.variables else {}
|
25
|
+
}
|
26
|
+
|
27
|
+
if obj.operation_name:
|
28
|
+
result["operation_name"] = obj.operation_name
|
29
|
+
|
30
|
+
return result
|
31
|
+
|
32
|
+
|
33
|
+
class ObjectsQueryResponseTranslator(MessageTranslator):
|
34
|
+
"""Translator for ObjectsQueryResponse schema objects"""
|
35
|
+
|
36
|
+
def to_pulsar(self, data: Dict[str, Any]) -> ObjectsQueryResponse:
|
37
|
+
raise NotImplementedError("Response translation to Pulsar not typically needed")
|
38
|
+
|
39
|
+
def from_pulsar(self, obj: ObjectsQueryResponse) -> Dict[str, Any]:
|
40
|
+
result = {}
|
41
|
+
|
42
|
+
# Handle GraphQL response data
|
43
|
+
if obj.data:
|
44
|
+
try:
|
45
|
+
result["data"] = json.loads(obj.data)
|
46
|
+
except json.JSONDecodeError:
|
47
|
+
result["data"] = obj.data
|
48
|
+
else:
|
49
|
+
result["data"] = None
|
50
|
+
|
51
|
+
# Handle GraphQL errors
|
52
|
+
if obj.errors:
|
53
|
+
result["errors"] = []
|
54
|
+
for error in obj.errors:
|
55
|
+
error_dict = {
|
56
|
+
"message": error.message
|
57
|
+
}
|
58
|
+
if error.path:
|
59
|
+
error_dict["path"] = list(error.path)
|
60
|
+
if error.extensions:
|
61
|
+
error_dict["extensions"] = dict(error.extensions)
|
62
|
+
result["errors"].append(error_dict)
|
63
|
+
|
64
|
+
# Handle extensions
|
65
|
+
if obj.extensions:
|
66
|
+
result["extensions"] = dict(obj.extensions)
|
67
|
+
|
68
|
+
# Handle system-level error
|
69
|
+
if obj.error:
|
70
|
+
result["error"] = {
|
71
|
+
"type": obj.error.type,
|
72
|
+
"message": obj.error.message
|
73
|
+
}
|
74
|
+
|
75
|
+
return result
|
76
|
+
|
77
|
+
def from_response_with_completion(self, obj: ObjectsQueryResponse) -> Tuple[Dict[str, Any], bool]:
|
78
|
+
"""Returns (response_dict, is_final)"""
|
79
|
+
return self.from_pulsar(obj), True
|
@@ -0,0 +1,28 @@
|
|
1
|
+
from pulsar.schema import Record, String, Map, Array
|
2
|
+
|
3
|
+
from ..core.primitives import Error
|
4
|
+
from ..core.topic import topic
|
5
|
+
|
6
|
+
############################################################################
|
7
|
+
|
8
|
+
# Objects Query Service - executes GraphQL queries against structured data
|
9
|
+
|
10
|
+
class GraphQLError(Record):
|
11
|
+
message = String()
|
12
|
+
path = Array(String()) # Path to the field that caused the error
|
13
|
+
extensions = Map(String()) # Additional error metadata
|
14
|
+
|
15
|
+
class ObjectsQueryRequest(Record):
|
16
|
+
user = String() # Cassandra keyspace (follows pattern from TriplesQueryRequest)
|
17
|
+
collection = String() # Data collection identifier (required for partition key)
|
18
|
+
query = String() # GraphQL query string
|
19
|
+
variables = Map(String()) # GraphQL variables
|
20
|
+
operation_name = String() # Operation to execute for multi-operation documents
|
21
|
+
|
22
|
+
class ObjectsQueryResponse(Record):
|
23
|
+
error = Error() # System-level error (connection, timeout, etc.)
|
24
|
+
data = String() # JSON-encoded GraphQL response data
|
25
|
+
errors = Array(GraphQLError()) # GraphQL field-level errors
|
26
|
+
extensions = Map(String()) # Query metadata (execution time, etc.)
|
27
|
+
|
28
|
+
############################################################################
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: trustgraph-base
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.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
|
Author-email: "trustgraph.ai" <security@trustgraph.ai>
|
6
6
|
Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
|
@@ -16,6 +16,7 @@ trustgraph/base/__init__.py
|
|
16
16
|
trustgraph/base/agent_client.py
|
17
17
|
trustgraph/base/agent_service.py
|
18
18
|
trustgraph/base/async_processor.py
|
19
|
+
trustgraph/base/cassandra_config.py
|
19
20
|
trustgraph/base/consumer.py
|
20
21
|
trustgraph/base/consumer_spec.py
|
21
22
|
trustgraph/base/document_embeddings_client.py
|
@@ -78,6 +79,7 @@ trustgraph/messaging/translators/flow.py
|
|
78
79
|
trustgraph/messaging/translators/knowledge.py
|
79
80
|
trustgraph/messaging/translators/library.py
|
80
81
|
trustgraph/messaging/translators/metadata.py
|
82
|
+
trustgraph/messaging/translators/objects_query.py
|
81
83
|
trustgraph/messaging/translators/primitives.py
|
82
84
|
trustgraph/messaging/translators/prompt.py
|
83
85
|
trustgraph/messaging/translators/retrieval.py
|
@@ -109,6 +111,7 @@ trustgraph/schema/services/library.py
|
|
109
111
|
trustgraph/schema/services/llm.py
|
110
112
|
trustgraph/schema/services/lookup.py
|
111
113
|
trustgraph/schema/services/nlp_query.py
|
114
|
+
trustgraph/schema/services/objects_query.py
|
112
115
|
trustgraph/schema/services/prompt.py
|
113
116
|
trustgraph/schema/services/query.py
|
114
117
|
trustgraph/schema/services/retrieval.py
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "1.3.2"
|
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-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/document_embeddings_client.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/document_embeddings_query_service.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/document_embeddings_store_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/base/graph_embeddings_query_service.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/document_embeddings_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/clients/graph_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
|
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-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/document_loading.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/embeddings.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/embeddings_query.py
RENAMED
File without changes
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/knowledge.py
RENAMED
File without changes
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/metadata.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/primitives.py
RENAMED
File without changes
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/retrieval.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/messaging/translators/text_completion.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
|
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph/schema/services/structured_query.py
RENAMED
File without changes
|
{trustgraph_base-1.3.2 → trustgraph_base-1.3.4}/trustgraph_base.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|