Documentation

latency

API latency benchmark models.

Classes

class

LatencyBenchmarkResult

(BaseModel)

Complete latency benchmark results.

Attributes

NameTypeDescription
category_statisticslist[LatencyStatistics] | None—
cf_overall_statsStatisticalSummary | None—
corpusstr—
measurementslist[QueryMeasurement]—
querieslist[SearchQuery]—
statisticslist[LatencyStatistics]—
tf_overall_statsStatisticalSummary | None—

Methods

get_queries_by_category(self, category: Literal[('lexical', 'structural', 'quantified', 'complex')]) → list[SearchQuery]

Get queries for a specific category.

Parameters
  • category: Literal[('lexical', 'structural', 'quantified', 'complex')]
get_validated_queries(self) → list[SearchQuery]

Get only validated queries.

to_dict(self) → dict

Convert to JSON-serializable dictionary.

to_json(self) → str

Serialize to JSON string.

class

LatencyStatistics

(BaseModel)

Latency statistics for a query or category.

Attributes

NameTypeDescription
categorystr | None—
error_countint—
implementationLiteral[('TF', 'CF')]—
max_msfloat—
mean_msfloat—
min_msfloat—
p50_msfloat—
p95_msfloat—
p99_msfloat—
query_idstr | None—
sample_countint—
std_msfloat—

Methods

to_dict(self) → dict

Convert to JSON-serializable dictionary.

class

QueryMeasurement

(BaseModel)

Single query timing measurement.

Attributes

NameTypeDescription
errorstr | None—
execution_time_msfloat—
implementationLiteral[('TF', 'CF')]—
iterationint—
query_idstr—
result_countint—
run_idint—
successbool—

Methods

to_dict(self) → dict

Convert to JSON-serializable dictionary.

class

SearchQuery

(BaseModel)

Search query for latency testing.

Attributes

NameTypeDescription
categoryLiteral[('lexical', 'structural', 'quantified', 'complex')]—
descriptionstr—
expected_complexityLiteral[('low', 'medium', 'high')]—
idstr—
templatestr—
validatedbool—
validation_errorstr | None—

Methods

to_dict(self) → dict

Convert to JSON-serializable dictionary.

class

ValidationReport

(BaseModel)

Report of query validation results.

Attributes

NameTypeDescription
failed_countint—
querieslist[SearchQuery]—
success_ratefloatCalculate validation success rate.
total_queriesint—
validated_countint—
validation_corpusstr—

Methods

to_dict(self) → dict

Convert to JSON-serializable dictionary.

to_json(self) → str

Serialize to JSON string.