Content Engine GraphQL API sample mutations and queries

You can get started with the following example mutations and queries to get started with processing genAI query objects using the Content Engine GraphQL API.

GenAI base query sample

The following mutation can be used to create a GenAI base query object:
mutation createBaseQuery($repo:String!, $props:[PropertyIdentifierAndScalarValue!],
  $className:String!){
  createCmAbstractPersistable(repositoryIdentifier: $repo, 
  classIdentifier:$className,
  cmAbstractPersistableProperties:
  {
    properties:$props
  })
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
		        "GenaiLLMModelName", 
      			   "GenaiLLMResponse",
      			])
    {
      alias
      value
    }
  }
}
A sample input for the mutation looks like this:
{
  "repo":"FNOS1",
  "props": [
    {"GenaiLLMPrompt":"Describe ECM"}
  ],
  "className": "GenAIBaseQuery"
}
The following query can be used to query a GenaiBaseQuery object:
query baseQuery($repo:String!, $id:String!,
  $className:String!){
  cmAbstractPersistable(repositoryIdentifier: $repo,
  identifier:$id,
  classIdentifier:$className)
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      ])
    {
      alias
      value
    }
  }
}
A sample input for the query looks like this:
{
  "repo":"FNOS1",
  "id": "{B0A7A18F-0000-CF1A-A47B-48ED6A93307F}",
  "className": "GenaiBaseQuery"
}

GenAI vector query sample

The following mutation can be used to create a GenAI vector query object:
mutation createVectorQuery($repo:String!, $props:[PropertyIdentifierAndScalarValue!],
  $className:String!){
  createCmAbstractPersistable(repositoryIdentifier: $repo, 
  classIdentifier:$className,
  cmAbstractPersistableProperties:
  {
    properties:$props
  })
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      "GenaiVectorChunks"
      "GenaiPerformLLMQuery"
      "GenaiMaxDocumentChunks"
      ])
    {
      alias
      value
    }
  }
}
A sample input for the mutation looks like this:
{
  "repo":"FNOS1",
  "props": [
    {"GenaiLLMPrompt":"What is FileNet"},    
    {"GenaiPerformLLMQuery": true},
    {"GenaiMaxDocumentChunks": 6}
  ],
  "className": "GenaiVectorQuery"
}
The following query can be used to query a GenaiVectorQuery object:
query vectorQuery($repo:String!, $id:String!,
  $className:String!){
  cmAbstractPersistable(repositoryIdentifier: $repo,
  identifier:$id,
  classIdentifier:$className)
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      "GenaiVectorChunks"
      "GenaiPerformLLMQuery"
      "GenaiMaxDocumentChunks"
      ])
    {
      alias
      value
    }
  }
} 
A sample input for the query looks like this:
{
  "repo":"FNOS1",
  "id": "{20CDA68F-0000-CD1E-B890-E603DE35F322}",
  "className": "GenAIVectorQuery"

GenAI document query sample

The following mutation can be used to create a GenAI document query object:
mutation createDocumentQuery($repo:String!, $props:[PropertyIdentifierAndScalarValue!],
  $className:String!){
  createCmAbstractPersistable(repositoryIdentifier: $repo, 
  classIdentifier:$className,
  cmAbstractPersistableProperties:
  {
    properties:$props
  })
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      "GenaiVectorChunks"
      "GenaiPerformLLMQuery"
      "GenaiMaxDocumentChunks"
      "GenaiContextDocument"
      ])
    {
      alias
      value
    }
  }
}
A sample input for the mutation looks like this:
{
  "repo":"FNOS1",
  "props": [
    {"GenaiLLMPrompt":"What is FileNet"},    
    {"GenaiPerformLLMQuery": true},
    {"GenaiMaxDocumentChunks": 6},
    {"GenaiContextDocument": 
    	{
        "identifier":"{E0CA358F-0000-CB1B-9871-077B3990CF74}",
        "classIdentifier":"{01A3A8C2-7AEC-11D1-A31B-0020AF9FBB1C}"
      }
    }
  ],
  "className": "GenaiDocumentQuery"
}
The following query can be used to query a GenaiDocumentQuery object:
query docQuery($repo:String!, $id:String!,
  $className:String!){
  cmAbstractPersistable(repositoryIdentifier: $repo,
  identifier:$id,
  classIdentifier:$className)
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      "GenaiVectorChunks"
      "GenaiPerformLLMQuery"
      "GenaiMaxDocumentChunks"
      "GenaiContextDocument"
      ])
    {
      alias
      value
    }
  }
}
A sample input for the query looks like this:
{
  "repo":"FNOS1",
  "id": "{503FA78F-0000-C32C-9BE5-FD37E37381B3}",
  "className": "GenAIDocumentQuery"
}

GenAI multi document query sample

The following mutation can be used to create a GenAI multi document query object:
mutation createMultiDocumentsQuery($repo:String!, $props:[PropertyIdentifierAndScalarValue!],
  $className:String!){
  createCmAbstractPersistable(repositoryIdentifier: $repo, 
  classIdentifier:$className,
  cmAbstractPersistableProperties:
  {
    properties:$props
  })
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      "GenaiVectorChunks"
      "GenaiPerformLLMQuery"
      "GenaiMaxDocumentChunks"
      "GenaiContextDocuments"
      ])
    {
      alias
      value
    }
  }
}
A sample input for the mutation looks like this:
{
  "repo":"FNOS1",
  "props": [
    {"GenaiLLMPrompt":"What letter Mark W. Delahay wrote to Lincoln in 1863"},    
    {"GenaiPerformLLMQuery": true},
    {"GenaiMaxDocumentChunks": 6},
    {"GenaiContextDocuments": 
    	["{E0CA358F-0000-CB1B-9871-077B3990CF74}"]    
    }
  ],
  "className": "GenaiMultiDocumentQuery"
}
The following query can be used to query a GenaiMultiDocumentQuery object:
query multidocQuery($repo:String!, $id:String!,
  $className:String!){
  cmAbstractPersistable(repositoryIdentifier: $repo,
  identifier:$id,
  classIdentifier:$className)
  {
    id
    name
    creator
    properties(includes:["GenaiLLMPrompt",
      "GenaiLLMModelName", 
      "GenaiLLMResponse",
      "GenaiVectorChunks"
      "GenaiPerformLLMQuery"
      "GenaiMaxDocumentChunks"
      "GenaiContextDocuments"
      ])
    {
      alias
      value
    }
  }
}
A sample input for the query looks like this:
{
  "repo":"FNOS1",
  "id": "{70CD358F-0000-C816-8E93-E05E301A7BA4}",
  "className": "GenAIMultiDocumentQuery"
}