trustgraph/trustgraph-base/trustgraph/schema/services/nlp_query.py
Cyber MacGeddon e606ed6e40 New schemas
2025-08-04 23:22:31 +01:00

22 lines
No EOL
831 B
Python

from pulsar.schema import Record, String, Array, Map, Integer, Double
from ..core.primitives import Error
from ..core.topic import topic
############################################################################
# NLP to Structured Query Service - converts natural language to GraphQL
class NLPToStructuredQueryRequest(Record):
natural_language_query = String()
max_results = Integer()
context_hints = Map(String()) # Optional context for query generation
class NLPToStructuredQueryResponse(Record):
error = Error()
graphql_query = String() # Generated GraphQL query
variables = Map(String()) # GraphQL variables if any
detected_schemas = Array(String()) # Which schemas the query targets
confidence = Double()
############################################################################