agents.research.perplexity.pro_search.models

Pydantic models for Perplexity-style quick search workflow. from typing import Any These models support a multi-stage search process with reasoning, query generation, parallel search execution, and synthesis.

Classes

ContentAnalysis

Analysis of search results content.

PerplexitySearchState

Complete state for Perplexity-style search workflow.

QueryBatch

Batch of queries to execute in parallel.

QueryIntent

Analyzed intent and characteristics of a search query.

QueryReasoning

Reasoning output for query understanding and expansion.

SearchContext

Context information for search query understanding.

SearchQueryConfig

Configuration for individual search queries.

SearchQueryResult

Results for a single search query.

SearchResult

Individual search result with metadata.

SearchSynthesis

Final synthesis of search results.

Module Contents

class agents.research.perplexity.pro_search.models.ContentAnalysis(/, **data)

Bases: pydantic.BaseModel

Analysis of search results content.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

adjust_confidence_by_contradictions()

Adjust confidence based on contradictions.

Return type:

ContentAnalysis

class agents.research.perplexity.pro_search.models.PerplexitySearchState(/, **data)

Bases: pydantic.BaseModel

Complete state for Perplexity-style search workflow.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

property is_complete: bool

Check if search workflow is complete.

Return type:

bool

property next_action: Literal['reason', 'generate_queries', 'search', 'synthesize', 'complete']

Determine next action in workflow.

Return type:

Literal[‘reason’, ‘generate_queries’, ‘search’, ‘synthesize’, ‘complete’]

class agents.research.perplexity.pro_search.models.QueryBatch(/, **data)

Bases: pydantic.BaseModel

Batch of queries to execute in parallel.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

validate_query_diversity()

Ensure queries are diverse and non-redundant.

Return type:

QueryBatch

property primary_queries: list[SearchQueryConfig]

Get primary queries only.

Return type:

list[SearchQueryConfig]

property total_expected_results: int

Calculate total expected results based on queries.

Return type:

int

class agents.research.perplexity.pro_search.models.QueryIntent(/, **data)

Bases: pydantic.BaseModel

Analyzed intent and characteristics of a search query.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

classmethod adjust_sources_by_complexity(v, info)

Adjust required sources based on complexity.

Return type:

Any

class agents.research.perplexity.pro_search.models.QueryReasoning(/, **data)

Bases: pydantic.BaseModel

Reasoning output for query understanding and expansion.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

validate_reasoning_completeness()

Ensure reasoning provides actionable insights.

Return type:

QueryReasoning

class agents.research.perplexity.pro_search.models.SearchContext(/, **data)

Bases: pydantic.BaseModel

Context information for search query understanding.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

property temporal_context: dict[str, str]

Generate temporal context strings.

Return type:

dict[str, str]

class agents.research.perplexity.pro_search.models.SearchQueryConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for individual search queries.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

classmethod clean_query_text(v)

Clean and validate query text.

Return type:

Any

class agents.research.perplexity.pro_search.models.SearchQueryResult(/, **data)

Bases: pydantic.BaseModel

Results for a single search query.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

property success: bool

Check if query executed successfully.

Return type:

bool

property top_results: list[SearchResult]

Get top 3 results by relevance.

Return type:

list[SearchResult]

class agents.research.perplexity.pro_search.models.SearchResult(/, **data)

Bases: pydantic.BaseModel

Individual search result with metadata.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

property age_days: int | None

Calculate age of content in days.

Return type:

int | None

property is_recent: bool

Check if content is recent (< 30 days).

Return type:

bool

class agents.research.perplexity.pro_search.models.SearchSynthesis(/, **data)

Bases: pydantic.BaseModel

Final synthesis of search results.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

ensure_citations()

Ensure citations are provided for summary.

Return type:

SearchSynthesis

property requires_follow_up: bool

Determine if follow-up search is needed.

Return type:

bool

property total_sources_used: int

Count total unique sources used.

Return type:

int