Standalone NAT Service#
Running Context Aware RAG NAT plugin as a service#
Export environment variables
Running Data Ingestion#
nat serve --config_file=./packages/vss_ctx_rag_nat/src/vss_ctx_rag/plugins/nat/nat_config/workflow/config-ingestion-workflow.yml --port <PORT>
Running Graph Retrieval#
nat serve --config_file=./packages/vss_ctx_rag_nat/src/vss_ctx_rag/plugins/nat/nat_config/workflow/config-retrieval-workflow.yml --port <PORT>
Example Python API calls to the service#
Here there are two services running, one for ingestion on port 8000 and one for retrieval on port 8001.
import requests
# Ingestion request
ingestion_url = "http://localhost:8000/generate"
ingestion_headers = {"Content-Type": "application/json"}
ingestion_data = {
"text": "The bridge is bright blue."
}
ingestion_response = requests.post(ingestion_url, headers=ingestion_headers, json=ingestion_data)
print("Ingestion Response:", ingestion_response.json())
# Retrieval request
retrieval_url = "http://localhost:8001/generate"
retrieval_headers = {"Content-Type": "application/json"}
retrieval_data = {
"input_message": "Is there a bridge? If so describe it"
}
retrieval_response = requests.post(retrieval_url, headers=retrieval_headers, json=retrieval_data)
print("Retrieval Response:", retrieval_response.json())