Guides Overview
The SDK offers two ways to run analyses:
Option 1: Helper Function
Use StartAnalysis for a streamlined experience. Supports all analysis types:
| Type | Description |
|---|---|
technical_report | Vehicle damage analysis (PDF) |
case_analysis | Case strength scores (JSON) |
cross_examination | Expert witness questions (PDF) |
research_scrutinizer | Research weakness analysis (PDF) |
poller, _ := silentwitness.StartAnalysis(ctx, &silentwitness.AnalyzeCaseRequest{
AnalysisType: silentwitness.AnalysisTypeTechnicalReport,
CaseName: silentwitness.String("Smith v. Jones"),
Plaintiff: &silentwitness.VehicleAnalysisData{Images: images},
})
result, _ := poller.Wait(ctx)
Best for: Most use cases, quick integration
Guides:
- Analyzing a Case - Run your first analysis
- Running Additional Analyses - Run another analysis on an existing case
Option 2: Low-Level SDK
Use individual SDK methods for full control over each step.
// 1. Create case
caseResp, _ := silentwitness.Cases.Create(ctx, &silentwitness.CreateCaseRequest{...})
// 2. Upload files
upload, _ := silentwitness.Files.Upload(ctx, &silentwitness.UploadFileRequest{...})
// 3. Create report
report, _ := silentwitness.Reports.Create(ctx, &silentwitness.CreateCrashReportRequest{...})
// 4. Poll for completion
for {
status, _ := silentwitness.Reports.GetResult(ctx, &silentwitness.GetResultRequest{...})
if status.Status == "completed" { break }
time.Sleep(5 * time.Second)
}
Best for: Custom workflows, partial processing, integrating into existing systems
Guides:
- Generating a Report - Step-by-step using the low-level SDK