Get Job Results#
View the results produced by a completed data generation job.
Prerequisites#
Before you can get results from a data generation job, make sure that you have:
Obtained the base URL of your NeMo Data Designer service
Set the
DATA_DESIGNER_BASE_URL
environment variable to your NeMo Data Designer service endpointA completed data generation job
export DATA_DESIGNER_BASE_URL="https://your-data-designer-service-url"
To Get Results from a Data Generation Job#
Choose one of the following options to get results from a completed data generation job.
import os
from nemo_microservices import NeMoMicroservices
# Initialize the client
client = NeMoMicroservices(
base_url=os.environ['DATA_DESIGNER_BASE_URL']
)
# Get job results
job_id = "job-abc123def456"
results = client.beta.data_designer.jobs.results.list(job_id)
print(f"Results for job {job_id}:")
for result in results:
print(f"Result ID: {result.id}")
print(f"Step: {result.step_name}")
print(f"Format: {result.format}")
print(f"Canonical: {result.canonical}")
print()
JOB_ID="job-abc123def456"
# Get job results
curl -X GET \
"${DATA_DESIGNER_BASE_URL}/v1beta1/data-designer/jobs/${JOB_ID}/results" \
-H 'Accept: application/json' \
| jq
Example Response
[
{
"id": "result-123-csv",
"step_name": "generate",
"format": "csv",
"canonical": true
},
{
"id": "result-123-json",
"step_name": "generate",
"format": "json",
"canonical": false
}
]
Get Specific Result#
You can also retrieve details about a specific result:
# Get specific result
result_id = "result-123-csv"
result = client.beta.data_designer.jobs.results.retrieve(
result_id,
job_id=job_id
)
print(f"Result ID: {result.id}")
print(f"Step: {result.step_name}")
print(f"Format: {result.format}")
print(f"Canonical: {result.canonical}")
RESULT_ID="result-123-csv"
curl -X GET \
"${DATA_DESIGNER_BASE_URL}/v1beta1/data-designer/jobs/${JOB_ID}/results/${RESULT_ID}" \
-H 'Accept: application/json' \
| jq
Result Properties#
id: Unique identifier for the result
step_name: Name of the workflow step that produced this result
format: File format of the result (e.g., “csv”, “json”, “parquet”)
canonical: Whether this is the primary/canonical result for the step