Migrate from setup.py to pyproject.toml (#440)

* Converted setup.py to pyproject.toml

* Modern package infrastructure as recommended by py docs
This commit is contained in:
cybermaggedon 2025-07-23 21:22:08 +01:00 committed by GitHub
parent d83e4e3d59
commit 98022d6af4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
145 changed files with 561 additions and 1159 deletions

View file

@ -9,11 +9,14 @@ permissions:
jobs:
container-push:
test:
name: Run tests
runs-on: ubuntu-latest
container:
image: python:3.12
steps:
- name: Checkout
uses: actions/checkout@v3

2
.gitignore vendored
View file

@ -6,11 +6,11 @@ env/
*.parquet
templates/values/version.jsonnet
trustgraph-base/trustgraph/base_version.py
trustgraph-cli/trustgraph/cli_version.py
trustgraph-bedrock/trustgraph/bedrock_version.py
trustgraph-embeddings-hf/trustgraph/embeddings_hf_version.py
trustgraph-flow/trustgraph/flow_version.py
trustgraph-ocr/trustgraph/ocr_version.py
trustgraph-parquet/trustgraph/parquet_version.py
trustgraph-vertexai/trustgraph/vertexai_version.py
trustgraph-cli/trustgraph/
vertexai/

View file

@ -21,15 +21,15 @@ wheels:
packages: update-package-versions
rm -rf dist/
cd trustgraph && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-base && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-flow && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-vertexai && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-bedrock && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-embeddings-hf && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-cli && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-ocr && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph-mcp && python3 setup.py sdist --dist-dir ../dist/
cd trustgraph && python -m build --sdist --outdir ../dist/
cd trustgraph-base && python -m build --sdist --outdir ../dist/
cd trustgraph-flow && python -m build --sdist --outdir ../dist/
cd trustgraph-vertexai && python -m build --sdist --outdir ../dist/
cd trustgraph-bedrock && python -m build --sdist --outdir ../dist/
cd trustgraph-embeddings-hf && python -m build --sdist --outdir ../dist/
cd trustgraph-cli && python -m build --sdist --outdir ../dist/
cd trustgraph-ocr && python -m build --sdist --outdir ../dist/
cd trustgraph-mcp && python -m build --sdist --outdir ../dist/
pypi-upload:
twine upload dist/*-${VERSION}.*
@ -124,7 +124,7 @@ JSONNET_FLAGS=-J templates -J .
update-templates: update-dcs
JSON_TO_YAML=python3 -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))'
JSON_TO_YAML=python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))'
update-dcs: set-version
for graph in ${GRAPHS}; do \

View file

@ -11,7 +11,7 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN dnf install -y python3.12 && \
alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
python -m ensurepip --upgrade && \
pip3 install --no-cache-dir wheel aiohttp && \
pip3 install --no-cache-dir build wheel aiohttp && \
pip3 install --no-cache-dir pulsar-client==3.7.0 && \
dnf clean all

View file

@ -11,7 +11,7 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN dnf install -y python3.12 && \
alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
python -m ensurepip --upgrade && \
pip3 install --no-cache-dir wheel aiohttp && \
pip3 install --no-cache-dir build wheel aiohttp && \
pip3 install --no-cache-dir pulsar-client==3.7.0 && \
dnf clean all

View file

@ -11,7 +11,7 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN dnf install -y python3.12 && \
alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
python -m ensurepip --upgrade && \
pip3 install --no-cache-dir wheel aiohttp rdflib && \
pip3 install --no-cache-dir build wheel aiohttp rdflib && \
pip3 install --no-cache-dir pulsar-client==3.7.0 && \
dnf clean all

View file

@ -11,7 +11,7 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN dnf install -y python3.12 && \
alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
python -m ensurepip --upgrade && \
pip3 install --no-cache-dir wheel aiohttp && \
pip3 install --no-cache-dir build wheel aiohttp && \
pip3 install --no-cache-dir pulsar-client==3.7.0 && \
dnf clean all

View file

@ -26,6 +26,8 @@ COPY trustgraph-mcp/ /root/build/trustgraph-mcp/
WORKDIR /root/build/
RUN pip3 install --no-cache-dir build wheel
RUN pip3 wheel -w /root/wheels/ --no-deps ./trustgraph-mcp/
RUN ls /root/wheels

View file

@ -12,7 +12,7 @@ RUN dnf install -y python3.12 && \
dnf install -y tesseract poppler-utils && \
alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
python -m ensurepip --upgrade && \
pip3 install --no-cache-dir wheel aiohttp && \
pip3 install --no-cache-dir build wheel aiohttp && \
pip3 install --no-cache-dir pulsar-client==3.7.0 && \
dnf clean all

View file

@ -11,7 +11,7 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN dnf install -y python3.12 && \
alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
python -m ensurepip --upgrade && \
pip3 install --no-cache-dir wheel aiohttp && \
pip3 install --no-cache-dir build wheel aiohttp && \
pip3 install --no-cache-dir pulsar-client==3.7.0 && \
pip3 install --no-cache-dir google-cloud-aiplatform && \
dnf clean all

View file

@ -0,0 +1,28 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trustgraph-base"
dynamic = ["version"]
authors = [{name = "trustgraph.ai", email = "security@trustgraph.ai"}]
description = "TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline."
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"pulsar-client",
"prometheus-client",
]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://github.com/trustgraph-ai/trustgraph"
[tool.setuptools.packages.find]
include = ["trustgraph*"]
[tool.setuptools.dynamic]
version = {attr = "trustgraph.base_version.__version__"}

View file

@ -1,42 +0,0 @@
import setuptools
import os
import importlib
with open("README.md", "r") as fh:
long_description = fh.read()
# Load a version number module
spec = importlib.util.spec_from_file_location(
'version', 'trustgraph/base_version.py'
)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
version = version_module.__version__
setuptools.setup(
name="trustgraph-base",
version=version,
author="trustgraph.ai",
author_email="security@trustgraph.ai",
description="TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/trustgraph-ai/trustgraph",
packages=setuptools.find_namespace_packages(
where='./',
),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
],
python_requires='>=3.8',
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
install_requires=[
"pulsar-client",
"prometheus-client",
],
scripts=[
]
)

View file

@ -0,0 +1,33 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trustgraph-bedrock"
dynamic = ["version"]
authors = [{name = "trustgraph.ai", email = "security@trustgraph.ai"}]
description = "TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline."
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"trustgraph-base>=1.2,<1.3",
"pulsar-client",
"prometheus-client",
"boto3",
]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://github.com/trustgraph-ai/trustgraph"
[project.scripts]
text-completion-bedrock = "trustgraph.model.text_completion.bedrock:run"
[tool.setuptools.packages.find]
include = ["trustgraph*"]
[tool.setuptools.dynamic]
version = {attr = "trustgraph.bedrock_version.__version__"}

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.model.text_completion.bedrock import run
run()

View file

@ -1,45 +0,0 @@
import setuptools
import os
import importlib
with open("README.md", "r") as fh:
long_description = fh.read()
# Load a version number module
spec = importlib.util.spec_from_file_location(
'version', 'trustgraph/bedrock_version.py'
)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
version = version_module.__version__
setuptools.setup(
name="trustgraph-bedrock",
version=version,
author="trustgraph.ai",
author_email="security@trustgraph.ai",
description="TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/trustgraph-ai/trustgraph",
packages=setuptools.find_namespace_packages(
where='./',
),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
],
python_requires='>=3.8',
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
install_requires=[
"trustgraph-base>=1.2,<1.3",
"pulsar-client",
"prometheus-client",
"boto3",
],
scripts=[
"scripts/text-completion-bedrock",
]
)

View file

@ -0,0 +1,85 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trustgraph-cli"
dynamic = ["version"]
authors = [{name = "trustgraph.ai", email = "security@trustgraph.ai"}]
description = "TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline."
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"trustgraph-base>=1.2,<1.3",
"requests",
"pulsar-client",
"aiohttp",
"rdflib",
"tabulate",
"msgpack",
"websockets",
]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://github.com/trustgraph-ai/trustgraph"
[project.scripts]
tg-add-library-document = "trustgraph.cli.add_library_document:main"
tg-delete-flow-class = "trustgraph.cli.delete_flow_class:main"
tg-delete-mcp-tool = "trustgraph.cli.delete_mcp_tool:main"
tg-delete-kg-core = "trustgraph.cli.delete_kg_core:main"
tg-delete-tool = "trustgraph.cli.delete_tool:main"
tg-dump-msgpack = "trustgraph.cli.dump_msgpack:main"
tg-get-flow-class = "trustgraph.cli.get_flow_class:main"
tg-get-kg-core = "trustgraph.cli.get_kg_core:main"
tg-graph-to-turtle = "trustgraph.cli.graph_to_turtle:main"
tg-init-trustgraph = "trustgraph.cli.init_trustgraph:main"
tg-invoke-agent = "trustgraph.cli.invoke_agent:main"
tg-invoke-document-rag = "trustgraph.cli.invoke_document_rag:main"
tg-invoke-graph-rag = "trustgraph.cli.invoke_graph_rag:main"
tg-invoke-llm = "trustgraph.cli.invoke_llm:main"
tg-invoke-mcp-tool = "trustgraph.cli.invoke_mcp_tool:main"
tg-invoke-prompt = "trustgraph.cli.invoke_prompt:main"
tg-load-doc-embeds = "trustgraph.cli.load_doc_embeds:main"
tg-load-kg-core = "trustgraph.cli.load_kg_core:main"
tg-load-pdf = "trustgraph.cli.load_pdf:main"
tg-load-sample-documents = "trustgraph.cli.load_sample_documents:main"
tg-load-text = "trustgraph.cli.load_text:main"
tg-load-turtle = "trustgraph.cli.load_turtle:main"
tg-put-flow-class = "trustgraph.cli.put_flow_class:main"
tg-put-kg-core = "trustgraph.cli.put_kg_core:main"
tg-remove-library-document = "trustgraph.cli.remove_library_document:main"
tg-save-doc-embeds = "trustgraph.cli.save_doc_embeds:main"
tg-set-mcp-tool = "trustgraph.cli.set_mcp_tool:main"
tg-set-prompt = "trustgraph.cli.set_prompt:main"
tg-set-token-costs = "trustgraph.cli.set_token_costs:main"
tg-set-tool = "trustgraph.cli.set_tool:main"
tg-show-config = "trustgraph.cli.show_config:main"
tg-show-flow-classes = "trustgraph.cli.show_flow_classes:main"
tg-show-flow-state = "trustgraph.cli.show_flow_state:main"
tg-show-flows = "trustgraph.cli.show_flows:main"
tg-show-graph = "trustgraph.cli.show_graph:main"
tg-show-kg-cores = "trustgraph.cli.show_kg_cores:main"
tg-show-library-documents = "trustgraph.cli.show_library_documents:main"
tg-show-library-processing = "trustgraph.cli.show_library_processing:main"
tg-show-mcp-tools = "trustgraph.cli.show_mcp_tools:main"
tg-show-processor-state = "trustgraph.cli.show_processor_state:main"
tg-show-prompts = "trustgraph.cli.show_prompts:main"
tg-show-token-costs = "trustgraph.cli.show_token_costs:main"
tg-show-token-rate = "trustgraph.cli.show_token_rate:main"
tg-show-tools = "trustgraph.cli.show_tools:main"
tg-start-flow = "trustgraph.cli.start_flow:main"
tg-unload-kg-core = "trustgraph.cli.unload_kg_core:main"
tg-start-library-processing = "trustgraph.cli.start_library_processing:main"
tg-stop-flow = "trustgraph.cli.stop_flow:main"
tg-stop-library-processing = "trustgraph.cli.stop_library_processing:main"
[tool.setuptools.packages.find]
include = ["trustgraph*"]
[tool.setuptools.dynamic]
version = {attr = "trustgraph.cli_version.__version__"}

View file

@ -1,97 +0,0 @@
import setuptools
import os
import importlib
with open("README.md", "r") as fh:
long_description = fh.read()
# Load a version number module
spec = importlib.util.spec_from_file_location(
'version', 'trustgraph/cli_version.py'
)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
version = version_module.__version__
setuptools.setup(
name="trustgraph-cli",
version=version,
author="trustgraph.ai",
author_email="security@trustgraph.ai",
description="TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/trustgraph-ai/trustgraph",
packages=setuptools.find_namespace_packages(
where='./',
),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
],
python_requires='>=3.8',
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
install_requires=[
"trustgraph-base>=1.2,<1.3",
"requests",
"pulsar-client",
"aiohttp",
"rdflib",
"tabulate",
"msgpack",
"websockets",
],
scripts=[
"scripts/tg-add-library-document",
"scripts/tg-delete-flow-class",
"scripts/tg-delete-mcp-tool",
"scripts/tg-delete-kg-core",
"scripts/tg-delete-tool",
"scripts/tg-dump-msgpack",
"scripts/tg-get-flow-class",
"scripts/tg-get-kg-core",
"scripts/tg-graph-to-turtle",
"scripts/tg-init-trustgraph",
"scripts/tg-invoke-agent",
"scripts/tg-invoke-document-rag",
"scripts/tg-invoke-graph-rag",
"scripts/tg-invoke-llm",
"scripts/tg-invoke-mcp-tool",
"scripts/tg-invoke-prompt",
"scripts/tg-load-doc-embeds",
"scripts/tg-load-kg-core",
"scripts/tg-load-pdf",
"scripts/tg-load-sample-documents",
"scripts/tg-load-text",
"scripts/tg-load-turtle",
"scripts/tg-put-flow-class",
"scripts/tg-put-kg-core",
"scripts/tg-remove-library-document",
"scripts/tg-save-doc-embeds",
"scripts/tg-set-mcp-tool",
"scripts/tg-set-prompt",
"scripts/tg-set-token-costs",
"scripts/tg-set-tool",
"scripts/tg-show-config",
"scripts/tg-show-flow-classes",
"scripts/tg-show-flow-state",
"scripts/tg-show-flows",
"scripts/tg-show-graph",
"scripts/tg-show-kg-cores",
"scripts/tg-show-library-documents",
"scripts/tg-show-library-processing",
"scripts/tg-show-mcp-tools",
"scripts/tg-show-processor-state",
"scripts/tg-show-prompts",
"scripts/tg-show-token-costs",
"scripts/tg-show-token-rate",
"scripts/tg-show-tools",
"scripts/tg-start-flow",
"scripts/tg-unload-kg-core",
"scripts/tg-start-library-processing",
"scripts/tg-stop-flow",
"scripts/tg-stop-library-processing",
]
)

View file

@ -0,0 +1 @@
# TrustGraph CLI modules

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Loads a document into the library
"""
@ -202,5 +200,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Deletes a flow class
"""
@ -49,5 +47,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Deletes a flow class
"""
@ -57,5 +55,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Deletes MCP (Model Control Protocol) tools from the TrustGraph system.
Removes MCP tool configurations by ID from the 'mcp' configuration group.
@ -91,4 +89,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Deletes tools from the TrustGraph system.
Removes tool configurations by ID from the agent configuration
@ -96,5 +94,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
This utility reads a knowledge core in msgpack format and outputs its
contents in JSON form to standard output. This is useful only as a
@ -89,5 +87,5 @@ def main():
else:
dump(**vars(args))
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Outputs a flow class definition in JSON format.
"""
@ -52,5 +50,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Uses the knowledge service to fetch a knowledge core which is saved
to a local file in msgpack format.
@ -157,5 +155,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Connects to the graph query service and dumps all graph edges in Turtle
format.
@ -102,5 +100,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Initialises Pulsar with Trustgraph tenant / namespaces & policy.
"""
@ -237,5 +235,5 @@ def main():
time.sleep(2)
print("Will retry...", flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Uses the agent service to answer a question
"""
@ -169,5 +167,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Uses the DocumentRAG service to answer a question
"""
@ -84,5 +82,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Uses the GraphRAG service to answer a question
"""
@ -113,5 +111,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Invokes the text completion service by specifying an LLM system prompt
and user prompt. Both arguments are required.
@ -66,5 +64,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Invokes MCP (Model Control Protocol) tools through the TrustGraph API.
Allows calling MCP tools by specifying the tool name and providing
@ -76,5 +74,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Invokes the LLM prompt service by specifying the prompt template to use
and values for the variables in the prompt template. The
@ -86,5 +84,5 @@ specified multiple times''',
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
This utility takes a document embeddings core and loads it into a running
TrustGraph through the API. The document embeddings core should be in msgpack

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Starts a load operation on a knowledge core which is already stored by
the knowledge manager. You could load a core with tg-put-kg-core and then
@ -76,5 +74,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Loads a PDF document into TrustGraph processing by directing to
the pdf-decoder queue.
@ -198,5 +196,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Loads a PDF document into the library
"""
@ -737,5 +735,5 @@ def main():
print("Exception:", e, flush=True)
raise e
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Loads a text document into TrustGraph processing by directing to a text
loader queue.
@ -203,6 +201,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Loads triples into the knowledge graph.
"""
@ -157,5 +155,5 @@ def main():
time.sleep(10)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Uploads a flow class definition. You can take the output of
tg-get-flow-class and load it back in using this utility.
@ -55,5 +53,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Uses the agent service to answer a question
"""
@ -179,5 +177,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Remove a document from the library
"""
@ -55,5 +53,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
This utility connects to a running TrustGraph through the API and creates
a document embeddings core from the data streaming through the processing

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Configures and registers MCP (Model Context Protocol) tools in the
TrustGraph system.
@ -107,5 +105,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Sets a prompt template.
"""
@ -139,5 +137,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Sets a model's token costs.
"""
@ -107,5 +105,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Configures and registers tools in the TrustGraph system.
@ -222,5 +220,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Dumps out the current configuration
"""
@ -45,5 +43,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Shows all defined flow classes.
"""
@ -65,5 +63,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Dump out a flow's processor states
"""
@ -89,5 +87,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Shows configured flows.
"""
@ -110,5 +108,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Connects to the graph query service and dumps all graph edges.
"""
@ -70,5 +68,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Shows knowledge cores
"""
@ -55,5 +53,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Shows all loaded library documents
"""
@ -72,5 +70,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
"""
@ -71,5 +69,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Displays the current MCP (Model Context Protocol) tool configuration
"""
@ -65,5 +63,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Dump out TrustGraph processor states.
"""
@ -51,5 +49,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Dumps out the current prompts
"""
@ -92,5 +90,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Dumps out token cost configuration
"""
@ -75,5 +73,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Dump out a stream of token rates, input, output and total. This is averaged
across the time since tg-show-token-rate is started.
@ -105,5 +103,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Displays the current agent tool configurations
@ -89,5 +87,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Starts a processing flow using a defined flow class
"""
@ -68,5 +66,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Submits a library document for processing
"""
@ -99,5 +97,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Stops a processing flow.
"""
@ -50,5 +48,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Removes a library document processing record. This is just a record of
procesing, it doesn't stop in-flight processing at the moment.
@ -61,5 +59,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
Starts a load operation on a knowledge core which is already stored by
the knowledge manager. You could load a core with tg-put-kg-core and then
@ -68,5 +66,5 @@ def main():
print("Exception:", e, flush=True)
main()
if __name__ == "__main__":
main()

View file

@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trustgraph-embeddings-hf"
dynamic = ["version"]
authors = [{name = "trustgraph.ai", email = "security@trustgraph.ai"}]
description = "HuggingFace embeddings support for TrustGraph."
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"trustgraph-base>=1.2,<1.3",
"trustgraph-flow>=1.2,<1.3",
"torch",
"urllib3",
"transformers",
"sentence-transformers",
"langchain",
"langchain-core",
"langchain-huggingface",
"langchain-community",
"huggingface-hub",
"pulsar-client",
"pyyaml",
"prometheus-client",
]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://github.com/trustgraph-ai/trustgraph"
[project.scripts]
embeddings-hf = "trustgraph.embeddings.hf:run"
[tool.setuptools.packages.find]
include = ["trustgraph*"]
[tool.setuptools.dynamic]
version = {attr = "trustgraph.embeddings_hf_version.__version__"}

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.embeddings.hf import run
run()

View file

@ -1,55 +0,0 @@
import setuptools
import os
import importlib
with open("README.md", "r") as fh:
long_description = fh.read()
# Load a version number module
spec = importlib.util.spec_from_file_location(
'version', 'trustgraph/embeddings_hf_version.py'
)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
version = version_module.__version__
setuptools.setup(
name="trustgraph-embeddings-hf",
version=version,
author="trustgraph.ai",
author_email="security@trustgraph.ai",
description="HuggingFace embeddings support for TrustGraph.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/trustgraph-ai/trustgraph",
packages=setuptools.find_namespace_packages(
where='./',
),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
],
python_requires='>=3.8',
download_url = "https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v" + version + ".tar.gz",
install_requires=[
"trustgraph-base>=1.2,<1.3",
"trustgraph-flow>=1.2,<1.3",
"torch",
"urllib3",
"transformers",
"sentence-transformers",
"langchain",
"langchain-core",
"langchain-huggingface",
"langchain-community",
"huggingface-hub",
"pulsar-client",
"pyyaml",
"prometheus-client",
],
scripts=[
"scripts/embeddings-hf",
]
)

View file

@ -0,0 +1,123 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trustgraph-flow"
dynamic = ["version"]
authors = [{name = "trustgraph.ai", email = "security@trustgraph.ai"}]
description = "TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline."
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"trustgraph-base>=1.2,<1.3",
"aiohttp",
"anthropic",
"cassandra-driver",
"cohere",
"cryptography",
"falkordb",
"fastembed",
"google-genai",
"ibis",
"jsonschema",
"langchain",
"langchain-community",
"langchain-core",
"langchain-text-splitters",
"mcp",
"minio",
"mistralai",
"neo4j",
"ollama",
"openai",
"pinecone[grpc]",
"prometheus-client",
"pulsar-client",
"pymilvus",
"pypdf",
"mistralai",
"pyyaml",
"qdrant-client",
"rdflib",
"requests",
"tabulate",
"tiktoken",
"urllib3",
]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://github.com/trustgraph-ai/trustgraph"
[project.scripts]
agent-manager-react = "trustgraph.agent.react:run"
api-gateway = "trustgraph.gateway:run"
chunker-recursive = "trustgraph.chunking.recursive:run"
chunker-token = "trustgraph.chunking.token:run"
config-svc = "trustgraph.config.service:run"
de-query-milvus = "trustgraph.query.doc_embeddings.milvus:run"
de-query-pinecone = "trustgraph.query.doc_embeddings.pinecone:run"
de-query-qdrant = "trustgraph.query.doc_embeddings.qdrant:run"
de-write-milvus = "trustgraph.storage.doc_embeddings.milvus:run"
de-write-pinecone = "trustgraph.storage.doc_embeddings.pinecone:run"
de-write-qdrant = "trustgraph.storage.doc_embeddings.qdrant:run"
document-embeddings = "trustgraph.embeddings.document_embeddings:run"
document-rag = "trustgraph.retrieval.document_rag:run"
embeddings-fastembed = "trustgraph.embeddings.fastembed:run"
embeddings-ollama = "trustgraph.embeddings.ollama:run"
ge-query-milvus = "trustgraph.query.graph_embeddings.milvus:run"
ge-query-pinecone = "trustgraph.query.graph_embeddings.pinecone:run"
ge-query-qdrant = "trustgraph.query.graph_embeddings.qdrant:run"
ge-write-milvus = "trustgraph.storage.graph_embeddings.milvus:run"
ge-write-pinecone = "trustgraph.storage.graph_embeddings.pinecone:run"
ge-write-qdrant = "trustgraph.storage.graph_embeddings.qdrant:run"
graph-embeddings = "trustgraph.embeddings.graph_embeddings:run"
graph-rag = "trustgraph.retrieval.graph_rag:run"
kg-extract-agent = "trustgraph.extract.kg.agent:run"
kg-extract-definitions = "trustgraph.extract.kg.definitions:run"
kg-extract-relationships = "trustgraph.extract.kg.relationships:run"
kg-extract-topics = "trustgraph.extract.kg.topics:run"
kg-manager = "trustgraph.cores:run"
kg-store = "trustgraph.storage.knowledge:run"
librarian = "trustgraph.librarian:run"
mcp-tool = "trustgraph.agent.mcp_tool:run"
metering = "trustgraph.metering:run"
object-extract-row = "trustgraph.extract.object.row:run"
oe-write-milvus = "trustgraph.storage.object_embeddings.milvus:run"
pdf-decoder = "trustgraph.decoding.pdf:run"
pdf-ocr-mistral = "trustgraph.decoding.mistral_ocr:run"
prompt-template = "trustgraph.prompt.template:run"
rev-gateway = "trustgraph.rev_gateway:run"
rows-write-cassandra = "trustgraph.storage.rows.cassandra:run"
run-processing = "trustgraph.processing:run"
text-completion-azure = "trustgraph.model.text_completion.azure:run"
text-completion-azure-openai = "trustgraph.model.text_completion.azure_openai:run"
text-completion-claude = "trustgraph.model.text_completion.claude:run"
text-completion-cohere = "trustgraph.model.text_completion.cohere:run"
text-completion-googleaistudio = "trustgraph.model.text_completion.googleaistudio:run"
text-completion-llamafile = "trustgraph.model.text_completion.llamafile:run"
text-completion-lmstudio = "trustgraph.model.text_completion.lmstudio:run"
text-completion-mistral = "trustgraph.model.text_completion.mistral:run"
text-completion-ollama = "trustgraph.model.text_completion.ollama:run"
text-completion-openai = "trustgraph.model.text_completion.openai:run"
text-completion-tgi = "trustgraph.model.text_completion.tgi:run"
text-completion-vllm = "trustgraph.model.text_completion.vllm:run"
triples-query-cassandra = "trustgraph.query.triples.cassandra:run"
triples-query-falkordb = "trustgraph.query.triples.falkordb:run"
triples-query-memgraph = "trustgraph.query.triples.memgraph:run"
triples-query-neo4j = "trustgraph.query.triples.neo4j:run"
triples-write-cassandra = "trustgraph.storage.triples.cassandra:run"
triples-write-falkordb = "trustgraph.storage.triples.falkordb:run"
triples-write-memgraph = "trustgraph.storage.triples.memgraph:run"
triples-write-neo4j = "trustgraph.storage.triples.neo4j:run"
wikipedia-lookup = "trustgraph.external.wikipedia:run"
[tool.setuptools.packages.find]
include = ["trustgraph*"]
[tool.setuptools.dynamic]
version = {attr = "trustgraph.flow_version.__version__"}

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.agent.react import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.gateway import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.chunking.recursive import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.chunking.token import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.config.service import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.query.doc_embeddings.milvus import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.query.doc_embeddings.pinecone import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.query.doc_embeddings.qdrant import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.storage.doc_embeddings.milvus import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.storage.doc_embeddings.pinecone import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.storage.doc_embeddings.qdrant import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.embeddings.document_embeddings import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.retrieval.document_rag import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.embeddings.fastembed import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.embeddings.ollama import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.query.graph_embeddings.milvus import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.query.graph_embeddings.pinecone import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.query.graph_embeddings.qdrant import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.storage.graph_embeddings.milvus import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.storage.graph_embeddings.pinecone import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.storage.graph_embeddings.qdrant import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.embeddings.graph_embeddings import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.retrieval.graph_rag import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.extract.kg.agent import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.extract.kg.definitions import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.extract.kg.relationships import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.extract.kg.topics import run
run()

View file

@ -1,6 +0,0 @@
#!/usr/bin/env python3
from trustgraph.cores import run
run()

Some files were not shown because too many files have changed in this diff Show more