mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-06-14 09:15:13 +02:00
IAM tech spec: Auth and access management current state and proposed
changes. Workspace support: - Support for separate workspaces - Addition of workspace CLI support for test purposes - Massive test update - Remove many 'user' references in services - workspace now provides the same separation - Update API
This commit is contained in:
parent
48da6c5f8b
commit
594deba73e
347 changed files with 6788 additions and 5540 deletions
|
|
@ -9,11 +9,12 @@ from trustgraph.api import Api
|
|||
|
||||
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
||||
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
||||
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
||||
|
||||
def query(url, flow_id, query_text, user, collection, limit, token=None):
|
||||
def query(url, flow_id, query_text, collection, limit, token=None, workspace="default"):
|
||||
|
||||
# Create API client
|
||||
api = Api(url=url, token=token)
|
||||
api = Api(url=url, token=token, workspace=workspace)
|
||||
socket = api.socket()
|
||||
flow = socket.flow(flow_id)
|
||||
|
||||
|
|
@ -21,7 +22,6 @@ def query(url, flow_id, query_text, user, collection, limit, token=None):
|
|||
# Call graph embeddings query service
|
||||
result = flow.graph_embeddings_query(
|
||||
text=query_text,
|
||||
user=user,
|
||||
collection=collection,
|
||||
limit=limit
|
||||
)
|
||||
|
|
@ -69,15 +69,15 @@ def main():
|
|||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-f', '--flow-id',
|
||||
default="default",
|
||||
help=f'Flow ID (default: default)'
|
||||
'-w', '--workspace',
|
||||
default=default_workspace,
|
||||
help=f'Workspace (default: {default_workspace})',
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-U', '--user',
|
||||
default="trustgraph",
|
||||
help='User/keyspace (default: trustgraph)',
|
||||
'-f', '--flow-id',
|
||||
default="default",
|
||||
help=f'Flow ID (default: default)'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
|
|
@ -107,10 +107,10 @@ def main():
|
|||
url=args.url,
|
||||
flow_id=args.flow_id,
|
||||
query_text=args.query[0],
|
||||
user=args.user,
|
||||
collection=args.collection,
|
||||
limit=args.limit,
|
||||
token=args.token,
|
||||
workspace=args.workspace,
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue