trustgraph-base 2.3.12__tar.gz → 2.3.14__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-2.3.12 → trustgraph_base-2.3.14}/PKG-INFO +1 -1
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/__init__.py +2 -1
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/agent_service.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/async_processor.py +11 -7
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/backend.py +53 -1
- trustgraph_base-2.3.14/trustgraph/base/config_client.py +92 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/consumer_spec.py +6 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/document_embeddings_query_service.py +6 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/document_embeddings_store_service.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/dynamic_tool_service.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/embeddings_service.py +5 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/flow.py +7 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/flow_processor.py +16 -13
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_embeddings_client.py +4 -1
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_embeddings_query_service.py +6 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_embeddings_store_service.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/llm_service.py +12 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/logging.py +4 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/metrics.py +22 -14
- trustgraph_base-2.3.14/trustgraph/base/parameter_spec.py +23 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/producer_spec.py +6 -4
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/prompt_client.py +2 -1
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/pubsub.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/pulsar_backend.py +20 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/rabbitmq_backend.py +165 -63
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/request_response_spec.py +5 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/subscriber_spec.py +6 -4
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/tool_client.py +7 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/tool_service.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/triples_client.py +5 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/triples_query_service.py +6 -3
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/triples_store_service.py +11 -2
- trustgraph_base-2.3.14/trustgraph/base_version.py +1 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/provenance/agent.py +2 -2
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/provenance/triples.py +5 -5
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph_base.egg-info/PKG-INFO +1 -1
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph_base.egg-info/SOURCES.txt +1 -0
- trustgraph_base-2.3.12/trustgraph/base/parameter_spec.py +0 -21
- trustgraph_base-2.3.12/trustgraph/base_version.py +0 -1
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/README.md +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/pyproject.toml +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/setup.cfg +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/api.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/async_bulk_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/async_flow.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/async_metrics.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/async_socket_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/bulk_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/collection.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/config.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/exceptions.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/explainability.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/flow.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/knowledge.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/library.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/metrics.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/socket_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/api/types.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/agent_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/cassandra_config.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/chunking_service.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/collection_config_handler.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/consumer.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/document_embeddings_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/embeddings_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_rag_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/librarian_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/processor_group.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/producer.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/publisher.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/row_embeddings_query_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/serialization.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/spec.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/structured_query_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/subscriber.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/text_completion_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/tool_service_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/agent_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/base.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/config_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/document_embeddings_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/document_rag_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/embeddings_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/graph_embeddings_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/graph_rag_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/llm_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/prompt_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/row_embeddings_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/clients/triples_query_client.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/exceptions.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/ar.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/en.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/es.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/he.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/hi.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/pt.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/ru.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/sw.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/tr.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/i18n/packs/zh-cn.json +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/knowledge/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/knowledge/defs.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/knowledge/document.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/knowledge/identifier.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/knowledge/organization.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/knowledge/publication.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/log_level.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/registry.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/agent.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/base.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/collection.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/config.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/diagnosis.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/document_loading.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/embeddings.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/embeddings_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/flow.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/knowledge.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/library.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/metadata.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/nlp_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/primitives.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/prompt.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/retrieval.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/rows_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/sparql_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/structured_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/text_completion.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/tool.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/messaging/translators/triples.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/objects/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/objects/field.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/objects/object.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/provenance/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/provenance/namespaces.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/provenance/uris.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/provenance/vocabulary.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/rdf.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/core/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/core/metadata.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/core/primitives.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/core/topic.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/document.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/embeddings.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/graph.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/knowledge.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/nlp.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/object.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/rows.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/knowledge/structured.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/__init__.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/agent.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/collection.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/config.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/diagnosis.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/flow.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/library.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/llm.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/lookup.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/nlp_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/prompt.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/retrieval.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/rows_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/sparql_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/storage.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/structured_query.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/schema/services/tool_service.py +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph_base.egg-info/dependency_links.txt +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph_base.egg-info/entry_points.txt +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph_base.egg-info/requires.txt +0 -0
- {trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/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: 2.3.
|
|
3
|
+
Version: 2.3.14
|
|
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
|
|
@@ -5,7 +5,7 @@ from . consumer import Consumer
|
|
|
5
5
|
from . producer import Producer
|
|
6
6
|
from . publisher import Publisher
|
|
7
7
|
from . subscriber import Subscriber
|
|
8
|
-
from . metrics import ProcessorMetrics, ConsumerMetrics, ProducerMetrics
|
|
8
|
+
from . metrics import ProcessorMetrics, ConsumerMetrics, ProducerMetrics, SubscriberMetrics
|
|
9
9
|
from . logging import add_logging_args, setup_logging
|
|
10
10
|
from . flow_processor import FlowProcessor
|
|
11
11
|
from . consumer_spec import ConsumerSpec
|
|
@@ -22,6 +22,7 @@ from . text_completion_client import (
|
|
|
22
22
|
TextCompletionClientSpec, TextCompletionClient, TextCompletionResult,
|
|
23
23
|
)
|
|
24
24
|
from . prompt_client import PromptClientSpec, PromptClient, PromptResult
|
|
25
|
+
from . config_client import ConfigClientSpec, ConfigClient
|
|
25
26
|
from . triples_store_service import TriplesStoreService
|
|
26
27
|
from . graph_embeddings_store_service import GraphEmbeddingsStoreService
|
|
27
28
|
from . document_embeddings_store_service import DocumentEmbeddingsStoreService
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Agent manager service completion base class
|
|
4
3
|
"""
|
|
5
4
|
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from argparse import ArgumentParser
|
|
8
|
+
|
|
6
9
|
import time
|
|
7
10
|
import logging
|
|
8
11
|
from prometheus_client import Histogram
|
|
@@ -97,7 +100,7 @@ class AgentService(FlowProcessor):
|
|
|
97
100
|
)
|
|
98
101
|
|
|
99
102
|
@staticmethod
|
|
100
|
-
def add_args(parser):
|
|
103
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
101
104
|
|
|
102
105
|
FlowProcessor.add_args(parser)
|
|
103
106
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from argparse import ArgumentParser
|
|
4
|
+
from typing import Any, Callable
|
|
1
5
|
|
|
2
6
|
# Base class for processors. Implements:
|
|
3
7
|
# - Pub/sub client, subscribe and consume basic
|
|
@@ -178,20 +182,20 @@ class AsyncProcessor:
|
|
|
178
182
|
|
|
179
183
|
# This is called to stop all threads. An over-ride point for extra
|
|
180
184
|
# functionality
|
|
181
|
-
def stop(self):
|
|
185
|
+
def stop(self) -> None:
|
|
182
186
|
self.pubsub_backend.close()
|
|
183
187
|
self.running = False
|
|
184
188
|
|
|
185
189
|
# Returns the pub/sub backend (new interface)
|
|
186
190
|
@property
|
|
187
|
-
def pubsub(self): return self.pubsub_backend
|
|
191
|
+
def pubsub(self) -> Any: return self.pubsub_backend
|
|
188
192
|
|
|
189
193
|
# Returns the pulsar host (backward compatibility)
|
|
190
194
|
@property
|
|
191
|
-
def pulsar_host(self): return self._pulsar_host
|
|
195
|
+
def pulsar_host(self) -> str: return self._pulsar_host
|
|
192
196
|
|
|
193
197
|
# Register a new event handler for configuration change
|
|
194
|
-
def register_config_handler(self, handler, types=None):
|
|
198
|
+
def register_config_handler(self, handler: Callable[..., Any], types: list[type] | None = None) -> None:
|
|
195
199
|
self.config_handlers.append({
|
|
196
200
|
"handler": handler,
|
|
197
201
|
"types": set(types) if types else None,
|
|
@@ -295,13 +299,13 @@ class AsyncProcessor:
|
|
|
295
299
|
raise e
|
|
296
300
|
|
|
297
301
|
@classmethod
|
|
298
|
-
def setup_logging(cls, args):
|
|
302
|
+
def setup_logging(cls, args: dict[str, Any]) -> None:
|
|
299
303
|
"""Configure logging for the entire application"""
|
|
300
304
|
setup_logging(args)
|
|
301
305
|
|
|
302
306
|
# Startup fabric. launch calls launch_async in async mode.
|
|
303
307
|
@classmethod
|
|
304
|
-
def launch(cls, ident, doc):
|
|
308
|
+
def launch(cls, ident: str, doc: str) -> None:
|
|
305
309
|
|
|
306
310
|
# Start assembling CLI arguments
|
|
307
311
|
parser = argparse.ArgumentParser(
|
|
@@ -374,7 +378,7 @@ class AsyncProcessor:
|
|
|
374
378
|
# The command-line arguments are built using a stack of add_args
|
|
375
379
|
# invocations
|
|
376
380
|
@staticmethod
|
|
377
|
-
def add_args(parser):
|
|
381
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
378
382
|
|
|
379
383
|
add_pubsub_args(parser)
|
|
380
384
|
add_logging_args(parser)
|
|
@@ -121,7 +121,7 @@ class PubSubBackend(Protocol):
|
|
|
121
121
|
Create a producer for a topic.
|
|
122
122
|
|
|
123
123
|
Args:
|
|
124
|
-
topic:
|
|
124
|
+
topic: Queue identifier in class:topicspace:topic format
|
|
125
125
|
schema: Dataclass type for messages
|
|
126
126
|
**options: Backend-specific options (e.g., chunking_enabled)
|
|
127
127
|
|
|
@@ -159,6 +159,58 @@ class PubSubBackend(Protocol):
|
|
|
159
159
|
"""
|
|
160
160
|
...
|
|
161
161
|
|
|
162
|
+
async def create_topic(self, topic: str) -> None:
|
|
163
|
+
"""
|
|
164
|
+
Create the broker-side resources for a logical topic.
|
|
165
|
+
|
|
166
|
+
For RabbitMQ this creates a fanout exchange. For Pulsar this is
|
|
167
|
+
a no-op (topics auto-create on first use).
|
|
168
|
+
|
|
169
|
+
Idempotent — creating an already-existing topic succeeds silently.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
topic: Topic identifier in class:topicspace:topic format
|
|
173
|
+
"""
|
|
174
|
+
...
|
|
175
|
+
|
|
176
|
+
async def delete_topic(self, topic: str) -> None:
|
|
177
|
+
"""
|
|
178
|
+
Delete a topic and discard any in-flight messages.
|
|
179
|
+
|
|
180
|
+
For RabbitMQ this deletes the fanout exchange; consumer queues
|
|
181
|
+
lose their binding and drain naturally.
|
|
182
|
+
|
|
183
|
+
Idempotent — deleting a non-existent topic succeeds silently.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
topic: Topic identifier in class:topicspace:topic format
|
|
187
|
+
"""
|
|
188
|
+
...
|
|
189
|
+
|
|
190
|
+
async def topic_exists(self, topic: str) -> bool:
|
|
191
|
+
"""
|
|
192
|
+
Check whether a topic exists.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
topic: Topic identifier in class:topicspace:topic format
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
True if the topic exists, False otherwise.
|
|
199
|
+
"""
|
|
200
|
+
...
|
|
201
|
+
|
|
202
|
+
async def ensure_topic(self, topic: str) -> None:
|
|
203
|
+
"""
|
|
204
|
+
Ensure a topic exists, creating it if necessary.
|
|
205
|
+
|
|
206
|
+
Convenience wrapper — checks existence, creates if missing.
|
|
207
|
+
Used by the flow service and system services on startup.
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
topic: Topic identifier in class:topicspace:topic format
|
|
211
|
+
"""
|
|
212
|
+
...
|
|
213
|
+
|
|
162
214
|
def close(self) -> None:
|
|
163
215
|
"""Close the backend connection."""
|
|
164
216
|
...
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
|
|
2
|
+
from . request_response_spec import RequestResponse, RequestResponseSpec
|
|
3
|
+
from .. schema import ConfigRequest, ConfigResponse, ConfigKey, ConfigValue
|
|
4
|
+
|
|
5
|
+
CONFIG_TIMEOUT = 10
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ConfigClient(RequestResponse):
|
|
9
|
+
|
|
10
|
+
async def _request(self, timeout=CONFIG_TIMEOUT, **kwargs):
|
|
11
|
+
resp = await self.request(
|
|
12
|
+
ConfigRequest(**kwargs),
|
|
13
|
+
timeout=timeout,
|
|
14
|
+
)
|
|
15
|
+
if resp.error:
|
|
16
|
+
raise RuntimeError(
|
|
17
|
+
f"{resp.error.type}: {resp.error.message}"
|
|
18
|
+
)
|
|
19
|
+
return resp
|
|
20
|
+
|
|
21
|
+
async def get(self, type, key, timeout=CONFIG_TIMEOUT):
|
|
22
|
+
"""Get a single config value. Returns the value string or None."""
|
|
23
|
+
resp = await self._request(
|
|
24
|
+
operation="get",
|
|
25
|
+
keys=[ConfigKey(type=type, key=key)],
|
|
26
|
+
timeout=timeout,
|
|
27
|
+
)
|
|
28
|
+
if resp.values and len(resp.values) > 0:
|
|
29
|
+
return resp.values[0].value
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
async def put(self, type, key, value, timeout=CONFIG_TIMEOUT):
|
|
33
|
+
"""Put a single config value."""
|
|
34
|
+
await self._request(
|
|
35
|
+
operation="put",
|
|
36
|
+
values=[ConfigValue(type=type, key=key, value=value)],
|
|
37
|
+
timeout=timeout,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
async def put_many(self, values, timeout=CONFIG_TIMEOUT):
|
|
41
|
+
"""Put multiple config values in a single request.
|
|
42
|
+
values is a list of (type, key, value) tuples."""
|
|
43
|
+
await self._request(
|
|
44
|
+
operation="put",
|
|
45
|
+
values=[
|
|
46
|
+
ConfigValue(type=t, key=k, value=v)
|
|
47
|
+
for t, k, v in values
|
|
48
|
+
],
|
|
49
|
+
timeout=timeout,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
async def delete(self, type, key, timeout=CONFIG_TIMEOUT):
|
|
53
|
+
"""Delete a single config key."""
|
|
54
|
+
await self._request(
|
|
55
|
+
operation="delete",
|
|
56
|
+
keys=[ConfigKey(type=type, key=key)],
|
|
57
|
+
timeout=timeout,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
async def delete_many(self, keys, timeout=CONFIG_TIMEOUT):
|
|
61
|
+
"""Delete multiple config keys in a single request.
|
|
62
|
+
keys is a list of (type, key) tuples."""
|
|
63
|
+
await self._request(
|
|
64
|
+
operation="delete",
|
|
65
|
+
keys=[
|
|
66
|
+
ConfigKey(type=t, key=k)
|
|
67
|
+
for t, k in keys
|
|
68
|
+
],
|
|
69
|
+
timeout=timeout,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
async def keys(self, type, timeout=CONFIG_TIMEOUT):
|
|
73
|
+
"""List all keys for a config type."""
|
|
74
|
+
resp = await self._request(
|
|
75
|
+
operation="list",
|
|
76
|
+
type=type,
|
|
77
|
+
timeout=timeout,
|
|
78
|
+
)
|
|
79
|
+
return resp.directory
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class ConfigClientSpec(RequestResponseSpec):
|
|
83
|
+
def __init__(
|
|
84
|
+
self, request_name, response_name,
|
|
85
|
+
):
|
|
86
|
+
super(ConfigClientSpec, self).__init__(
|
|
87
|
+
request_name=request_name,
|
|
88
|
+
request_schema=ConfigRequest,
|
|
89
|
+
response_name=response_name,
|
|
90
|
+
response_schema=ConfigResponse,
|
|
91
|
+
impl=ConfigClient,
|
|
92
|
+
)
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
1
4
|
|
|
2
5
|
from . metrics import ConsumerMetrics
|
|
3
6
|
from . consumer import Consumer
|
|
4
7
|
from . spec import Spec
|
|
5
8
|
|
|
6
9
|
class ConsumerSpec(Spec):
|
|
7
|
-
def __init__(self, name, schema, handler, concurrency = 1):
|
|
10
|
+
def __init__(self, name: str, schema: Any, handler: Any, concurrency: int = 1) -> None:
|
|
8
11
|
self.name = name
|
|
9
12
|
self.schema = schema
|
|
10
13
|
self.handler = handler
|
|
11
14
|
self.concurrency = concurrency
|
|
12
15
|
|
|
13
|
-
def add(self, flow, processor, definition):
|
|
16
|
+
def add(self, flow: Any, processor: Any, definition: dict[str, Any]) -> None:
|
|
14
17
|
|
|
15
18
|
consumer_metrics = ConsumerMetrics(
|
|
16
19
|
processor = flow.id, flow = flow.name, name = self.name,
|
|
@@ -20,7 +23,7 @@ class ConsumerSpec(Spec):
|
|
|
20
23
|
taskgroup = processor.taskgroup,
|
|
21
24
|
flow = flow,
|
|
22
25
|
backend = processor.pubsub,
|
|
23
|
-
topic = definition[self.name],
|
|
26
|
+
topic = definition["topics"][self.name],
|
|
24
27
|
subscriber = processor.id + "--" + flow.name + "--" + self.name,
|
|
25
28
|
schema = self.schema,
|
|
26
29
|
handler = self.handler,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Document embeddings query service. Input is vectors. Output is list of
|
|
4
3
|
embeddings.
|
|
5
4
|
"""
|
|
6
5
|
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from argparse import ArgumentParser
|
|
9
|
+
|
|
7
10
|
import logging
|
|
8
11
|
|
|
9
12
|
from .. schema import DocumentEmbeddingsRequest, DocumentEmbeddingsResponse
|
|
@@ -82,7 +85,7 @@ class DocumentEmbeddingsQueryService(FlowProcessor):
|
|
|
82
85
|
await flow("response").send(r, properties={"id": id})
|
|
83
86
|
|
|
84
87
|
@staticmethod
|
|
85
|
-
def add_args(parser):
|
|
88
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
86
89
|
|
|
87
90
|
FlowProcessor.add_args(parser)
|
|
88
91
|
|
|
@@ -93,7 +96,7 @@ class DocumentEmbeddingsQueryService(FlowProcessor):
|
|
|
93
96
|
help=f'Number of concurrent requests (default: {default_concurrency})'
|
|
94
97
|
)
|
|
95
98
|
|
|
96
|
-
def run():
|
|
99
|
+
def run() -> None:
|
|
97
100
|
|
|
98
101
|
Processor.launch(default_ident, __doc__)
|
|
99
102
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Document embeddings store base class
|
|
4
3
|
"""
|
|
5
4
|
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from argparse import ArgumentParser
|
|
8
|
+
|
|
6
9
|
import logging
|
|
7
10
|
|
|
8
11
|
from .. schema import DocumentEmbeddings
|
|
@@ -49,7 +52,7 @@ class DocumentEmbeddingsStoreService(FlowProcessor):
|
|
|
49
52
|
raise e
|
|
50
53
|
|
|
51
54
|
@staticmethod
|
|
52
|
-
def add_args(parser):
|
|
55
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
53
56
|
|
|
54
57
|
FlowProcessor.add_args(parser)
|
|
55
58
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Base class for dynamically pluggable tool services.
|
|
4
3
|
|
|
@@ -11,6 +10,10 @@ Uses direct Pulsar topics (no flow configuration required):
|
|
|
11
10
|
- Response: non-persistent://tg/response/{topic}
|
|
12
11
|
"""
|
|
13
12
|
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from argparse import ArgumentParser
|
|
16
|
+
|
|
14
17
|
import json
|
|
15
18
|
import logging
|
|
16
19
|
import asyncio
|
|
@@ -173,7 +176,7 @@ class DynamicToolService(AsyncProcessor):
|
|
|
173
176
|
raise NotImplementedError("Subclasses must implement invoke()")
|
|
174
177
|
|
|
175
178
|
@staticmethod
|
|
176
|
-
def add_args(parser):
|
|
179
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
177
180
|
|
|
178
181
|
AsyncProcessor.add_args(parser)
|
|
179
182
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Embeddings resolution base class
|
|
4
3
|
"""
|
|
5
4
|
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from argparse import ArgumentParser
|
|
8
|
+
|
|
6
9
|
import time
|
|
7
10
|
import logging
|
|
8
11
|
from prometheus_client import Histogram
|
|
@@ -100,7 +103,7 @@ class EmbeddingsService(FlowProcessor):
|
|
|
100
103
|
)
|
|
101
104
|
|
|
102
105
|
@staticmethod
|
|
103
|
-
def add_args(parser):
|
|
106
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
104
107
|
|
|
105
108
|
parser.add_argument(
|
|
106
109
|
'-c', '--concurrency',
|
|
@@ -112,4 +115,3 @@ class EmbeddingsService(FlowProcessor):
|
|
|
112
115
|
FlowProcessor.add_args(parser)
|
|
113
116
|
|
|
114
117
|
|
|
115
|
-
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
import asyncio
|
|
3
3
|
|
|
4
4
|
class Flow:
|
|
5
|
+
"""
|
|
6
|
+
Runtime representation of a deployed flow process.
|
|
7
|
+
|
|
8
|
+
This class maintains internal processor states and orchestrates
|
|
9
|
+
lifecycles (start, stop) for inputs (consumers) and parameters
|
|
10
|
+
that drive data flowing across linked nodes.
|
|
11
|
+
"""
|
|
5
12
|
def __init__(self, id, flow, processor, defn):
|
|
6
13
|
|
|
7
14
|
self.id = id
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
from argparse import ArgumentParser
|
|
1
5
|
|
|
2
6
|
# Base class for processor with management of flows in & out which are managed
|
|
3
7
|
# by configuration. This is probably all processor types, except for the
|
|
@@ -25,9 +29,9 @@ class FlowProcessor(AsyncProcessor):
|
|
|
25
29
|
# Initialise base class
|
|
26
30
|
super(FlowProcessor, self).__init__(**params)
|
|
27
31
|
|
|
28
|
-
# Register configuration handler
|
|
32
|
+
# Register configuration handler for this processor's config type
|
|
29
33
|
self.register_config_handler(
|
|
30
|
-
self.on_configure_flows, types=["
|
|
34
|
+
self.on_configure_flows, types=[f"processor:{self.id}"]
|
|
31
35
|
)
|
|
32
36
|
|
|
33
37
|
# Initialise flow information state
|
|
@@ -41,7 +45,7 @@ class FlowProcessor(AsyncProcessor):
|
|
|
41
45
|
logger.info("Service initialised.")
|
|
42
46
|
|
|
43
47
|
# Register a configuration variable
|
|
44
|
-
def register_specification(self, spec):
|
|
48
|
+
def register_specification(self, spec: Any) -> None:
|
|
45
49
|
self.specifications.append(spec)
|
|
46
50
|
|
|
47
51
|
# Start processing for a new flow
|
|
@@ -62,17 +66,16 @@ class FlowProcessor(AsyncProcessor):
|
|
|
62
66
|
|
|
63
67
|
logger.info(f"Got config version {version}")
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
if "active-flow" not in config: return
|
|
67
|
-
|
|
68
|
-
# Check there's configuration information for me
|
|
69
|
-
if self.id in config["active-flow"]:
|
|
70
|
-
|
|
71
|
-
# Get my flow config
|
|
72
|
-
flow_config = json.loads(config["active-flow"][self.id])
|
|
69
|
+
config_type = f"processor:{self.id}"
|
|
73
70
|
|
|
71
|
+
# Get my flow config — each key is a variant, each value is
|
|
72
|
+
# the JSON config for that flow variant
|
|
73
|
+
if config_type in config:
|
|
74
|
+
flow_config = {
|
|
75
|
+
k: json.loads(v)
|
|
76
|
+
for k, v in config[config_type].items()
|
|
77
|
+
}
|
|
74
78
|
else:
|
|
75
|
-
|
|
76
79
|
logger.debug("No configuration settings for me.")
|
|
77
80
|
flow_config = {}
|
|
78
81
|
|
|
@@ -99,7 +102,7 @@ class FlowProcessor(AsyncProcessor):
|
|
|
99
102
|
await super(FlowProcessor, self).start()
|
|
100
103
|
|
|
101
104
|
@staticmethod
|
|
102
|
-
def add_args(parser):
|
|
105
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
103
106
|
|
|
104
107
|
AsyncProcessor.add_args(parser)
|
|
105
108
|
|
{trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_embeddings_client.py
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
1
4
|
|
|
2
5
|
import logging
|
|
3
6
|
|
|
@@ -9,7 +12,7 @@ from .. knowledge import Uri, Literal
|
|
|
9
12
|
logger = logging.getLogger(__name__)
|
|
10
13
|
|
|
11
14
|
|
|
12
|
-
def to_value(x):
|
|
15
|
+
def to_value(x: Any) -> Any:
|
|
13
16
|
"""Convert schema Term to Uri or Literal."""
|
|
14
17
|
if x.type == IRI:
|
|
15
18
|
return Uri(x.iri)
|
{trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_embeddings_query_service.py
RENAMED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Graph embeddings query service. Input is vectors. Output is list of
|
|
4
3
|
embeddings.
|
|
5
4
|
"""
|
|
6
5
|
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from argparse import ArgumentParser
|
|
9
|
+
|
|
7
10
|
import logging
|
|
8
11
|
|
|
9
12
|
from .. schema import GraphEmbeddingsRequest, GraphEmbeddingsResponse
|
|
@@ -82,7 +85,7 @@ class GraphEmbeddingsQueryService(FlowProcessor):
|
|
|
82
85
|
await flow("response").send(r, properties={"id": id})
|
|
83
86
|
|
|
84
87
|
@staticmethod
|
|
85
|
-
def add_args(parser):
|
|
88
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
86
89
|
|
|
87
90
|
FlowProcessor.add_args(parser)
|
|
88
91
|
|
|
@@ -93,7 +96,7 @@ class GraphEmbeddingsQueryService(FlowProcessor):
|
|
|
93
96
|
help=f'Number of concurrent requests (default: {default_concurrency})'
|
|
94
97
|
)
|
|
95
98
|
|
|
96
|
-
def run():
|
|
99
|
+
def run() -> None:
|
|
97
100
|
|
|
98
101
|
Processor.launch(default_ident, __doc__)
|
|
99
102
|
|
{trustgraph_base-2.3.12 → trustgraph_base-2.3.14}/trustgraph/base/graph_embeddings_store_service.py
RENAMED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
Graph embeddings store base class
|
|
4
3
|
"""
|
|
5
4
|
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from argparse import ArgumentParser
|
|
8
|
+
|
|
6
9
|
import logging
|
|
7
10
|
|
|
8
11
|
from .. schema import GraphEmbeddings
|
|
@@ -49,7 +52,7 @@ class GraphEmbeddingsStoreService(FlowProcessor):
|
|
|
49
52
|
raise e
|
|
50
53
|
|
|
51
54
|
@staticmethod
|
|
52
|
-
def add_args(parser):
|
|
55
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
53
56
|
|
|
54
57
|
FlowProcessor.add_args(parser)
|
|
55
58
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
"""
|
|
3
2
|
LLM text completion base class
|
|
4
3
|
"""
|
|
5
4
|
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from argparse import ArgumentParser
|
|
8
|
+
|
|
6
9
|
import time
|
|
7
10
|
import logging
|
|
8
11
|
from prometheus_client import Histogram, Info
|
|
@@ -42,6 +45,12 @@ class LlmChunk:
|
|
|
42
45
|
__slots__ = ["text", "in_token", "out_token", "model", "is_final"]
|
|
43
46
|
|
|
44
47
|
class LlmService(FlowProcessor):
|
|
48
|
+
"""
|
|
49
|
+
Extensible service processing requests to Large Language Models (LLMs).
|
|
50
|
+
|
|
51
|
+
This class handles the core logic of dispatching text completion or chat requests
|
|
52
|
+
to integrated underlying LLM providers (e.g. OpenAI, vertex ai).
|
|
53
|
+
"""
|
|
45
54
|
|
|
46
55
|
def __init__(self, **params):
|
|
47
56
|
|
|
@@ -199,7 +208,7 @@ class LlmService(FlowProcessor):
|
|
|
199
208
|
properties={"id": id}
|
|
200
209
|
)
|
|
201
210
|
|
|
202
|
-
def supports_streaming(self):
|
|
211
|
+
def supports_streaming(self) -> bool:
|
|
203
212
|
"""
|
|
204
213
|
Override in subclass to indicate streaming support.
|
|
205
214
|
Returns False by default.
|
|
@@ -215,7 +224,7 @@ class LlmService(FlowProcessor):
|
|
|
215
224
|
raise NotImplementedError("Streaming not implemented for this provider")
|
|
216
225
|
|
|
217
226
|
@staticmethod
|
|
218
|
-
def add_args(parser):
|
|
227
|
+
def add_args(parser: ArgumentParser) -> None:
|
|
219
228
|
|
|
220
229
|
parser.add_argument(
|
|
221
230
|
'-c', '--concurrency',
|
|
@@ -11,7 +11,9 @@ Supports dual output to console and Loki for centralized log aggregation.
|
|
|
11
11
|
import contextvars
|
|
12
12
|
import logging
|
|
13
13
|
import logging.handlers
|
|
14
|
+
from argparse import ArgumentParser
|
|
14
15
|
from queue import Queue
|
|
16
|
+
from typing import Any
|
|
15
17
|
import os
|
|
16
18
|
|
|
17
19
|
|
|
@@ -53,7 +55,7 @@ class _ProcessorIdFilter(logging.Filter):
|
|
|
53
55
|
return True
|
|
54
56
|
|
|
55
57
|
|
|
56
|
-
def add_logging_args(parser):
|
|
58
|
+
def add_logging_args(parser: ArgumentParser) -> None:
|
|
57
59
|
"""
|
|
58
60
|
Add standard logging arguments to an argument parser.
|
|
59
61
|
|
|
@@ -100,7 +102,7 @@ def add_logging_args(parser):
|
|
|
100
102
|
)
|
|
101
103
|
|
|
102
104
|
|
|
103
|
-
def setup_logging(args):
|
|
105
|
+
def setup_logging(args: dict[str, Any]) -> None:
|
|
104
106
|
"""
|
|
105
107
|
Configure logging from parsed command-line arguments.
|
|
106
108
|
|