Skip to content

Commit

Permalink
Add agents, graphs, orgs, and update blobstores
Browse files Browse the repository at this point in the history
  • Loading branch information
Affie committed Feb 14, 2025
1 parent 1a77757 commit d493ff8
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 0 deletions.
71 changes: 71 additions & 0 deletions agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[operations]

QUERY_GET_AGENT = """
query QUERY_GET_AGENT($agentId: ID!) {
agents (where: {id: $agentId}) {
id
label
createdTimestamp
namespace
}
}
"""

GQL_ADD_AGENTS = """
mutation addAgents($input: [AgentCreateInput!]!) {
addAgents(input: $input) {
agents {
label
createdTimestamp
namespace
}
}
}
"""

GQL_DELETE_AGENT = """
mutation deleteAgent($id: ID!) {
deleteAgents(
where: { id: $id }
delete: {
blobEntries: {
where: { node: { parentConnection: {Agent: {node: {id: $id } } } } }
}
}
) {
nodesDeleted
relationshipsDeleted
}
}
"""

QUERY_LIST_AGENTS = """
query listAgents($id: ID!) {
orgs(where: {id: $id}) {
agents {
label
}
}
}
"""

QUERY_GET_AGENT_METADATA = """
query getAgentMetadata($id: ID!) {
agents(where: {id: $id}) {
metadata
}
}
"""

QUERY_SET_AGENT_METADATA = """
mutation setAgentMetadata($id: ID!, $meta: String!) {
updateAgents(
where: { id: $id }
update: { metadata: $meta }
) {
agents {
metadata
}
}
}
"""
12 changes: 12 additions & 0 deletions blobstores.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@ mutation deleteBlob(
deleteBlob(blobId: $blobId, store: {label: $label, type: $type})
}
"""

QUERY_LIST_BLOBS = """
query listBlobs($label: String = "default", $type: BlobStoreType = NVA_CLOUD) {
listBlobs(store: {label: $label, type: $type})
}
"""

QUERY_HAS_BLOB = """
query hasBlob($blobId: ID!, $label: String = "default", $type: BlobStoreType = NVA_CLOUD) {
hasBlob(blobId: $blobId, store: {label: $label, type: $type})
}
"""
116 changes: 116 additions & 0 deletions graph.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
[operations]

QUERY_GET_GRAPH = """
query getGraph($fgId: ID!) {
factorgraphs (where: {id: $fgId}) {
label
createdTimestamp
namespace
}
}
"""

MUTATION_ADD_GRAPH = """
mutation addGraph(
$orgId: ID = ""
$id: ID = "",
$label: String = "",
$description: String = "",
$metadata: String = "",
$_version: String = "",
) {
addFactorgraphs(
input: {id: $id, label: $label, _version: $_version, description: $description, metadata: $metadata, org: {connect: {where: {node: {id: $orgId}}}}}
) {
factorgraphs {
label
createdTimestamp
namespace
}
}
}
"""

MUTATION_DELETE_GRAPH = """
mutation deleteGraph($id: ID!) {
deleteFactorgraphs(
where: { id: $id }
delete: {
blobEntries: {
where: { node: { parentConnection: {Factorgraph: {node: {id: $id } } } } }
}
}
) {
nodesDeleted
relationshipsDeleted
}
}
"""

QUERY_LIST_GRAPHS = """
query listGraphs($id: ID!) {
orgs(where: {id: $id}) {
fgs {
label
}
}
}
"""

QUERY_GET_GRAPH_METADATA = """
query getGraphMetadata($id: ID!) {
factorgraphs(where: {id: $id}) {
metadata
}
}
"""

MUTATION_SET_GRAPH_METADATA = """
mutation setGraphMetadata($id: ID!, $meta: String!) {
updateFactorgraphs(
where: { id: $id }
update: { metadata: $meta }
) {
factorgraphs {
metadata
}
}
}
"""

GQL_CONNECT_GRAPH_TO_MODEL = """
mutation connectGraphModel($modelId: ID!, $fgId: ID!) {
updateModels(
where: { id: $modelId }
update: { fgs: { connect: { where: { node: { id: $fgId } } } } }
) {
info {
relationshipsCreated
}
}
}
"""

GQL_CONNECT_GRAPH_TO_AGENT = """
mutation connectGraphModel($agentId: ID!, $fgId: ID!) {
updateAgents(
where: { id: $agentId }
update: { fgs: { connect: { where: { node: { id: $fgId } } } } }
) {
info {
relationshipsCreated
}
}
}
"""

QUERY_GET_GRAPHS_AGENTS = """
query getAgents_Graph($id: ID!) {
factorgraphs(where: {id: $id}) {
agents {
label
namespace
}
}
}
"""
33 changes: 33 additions & 0 deletions org.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[operations]

GQL_ADD_ORG = """
mutation addOrg($label: String!, $description: String = "") {
addOrgs(input: {label: $label, description: $description}) {
orgs {
id
label
description
}
}
}
"""

GQL_GET_ORG = """
query getOrg($label: String!) {
orgs(where: {label: $label}) {
id
label
description
}
}
"""

GQL_GET_ORGS = """
query getOrgs{
orgs{
id
label
description
}
}
"""

0 comments on commit d493ff8

Please sign in to comment.