haive.agents.research.perplexity.pro_search.models ================================================== .. py:module:: haive.agents.research.perplexity.pro_search.models .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: haive.agents.research.perplexity.pro_search.models.ContentAnalysis haive.agents.research.perplexity.pro_search.models.PerplexitySearchState haive.agents.research.perplexity.pro_search.models.QueryBatch haive.agents.research.perplexity.pro_search.models.QueryIntent haive.agents.research.perplexity.pro_search.models.QueryReasoning haive.agents.research.perplexity.pro_search.models.SearchContext haive.agents.research.perplexity.pro_search.models.SearchQueryConfig haive.agents.research.perplexity.pro_search.models.SearchQueryResult haive.agents.research.perplexity.pro_search.models.SearchResult haive.agents.research.perplexity.pro_search.models.SearchSynthesis Module Contents --------------- .. py:class:: ContentAnalysis(/, **data) Bases: :py:obj:`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. .. py:method:: adjust_confidence_by_contradictions() Adjust confidence based on contradictions. .. py:class:: PerplexitySearchState(/, **data) Bases: :py:obj:`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. .. py:property:: is_complete :type: bool Check if search workflow is complete. .. py:property:: next_action :type: Literal['reason', 'generate_queries', 'search', 'synthesize', 'complete'] Determine next action in workflow. .. py:class:: QueryBatch(/, **data) Bases: :py:obj:`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. .. py:method:: validate_query_diversity() Ensure queries are diverse and non-redundant. .. py:property:: primary_queries :type: list[SearchQueryConfig] Get primary queries only. .. py:property:: total_expected_results :type: int Calculate total expected results based on queries. .. py:class:: QueryIntent(/, **data) Bases: :py:obj:`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. .. py:method:: adjust_sources_by_complexity(v, info) :classmethod: Adjust required sources based on complexity. .. py:class:: QueryReasoning(/, **data) Bases: :py:obj:`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. .. py:method:: validate_reasoning_completeness() Ensure reasoning provides actionable insights. .. py:class:: SearchContext(/, **data) Bases: :py:obj:`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. .. py:property:: temporal_context :type: dict[str, str] Generate temporal context strings. .. py:class:: SearchQueryConfig(/, **data) Bases: :py:obj:`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. .. py:method:: clean_query_text(v) :classmethod: Clean and validate query text. .. py:class:: SearchQueryResult(/, **data) Bases: :py:obj:`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. .. py:property:: success :type: bool Check if query executed successfully. .. py:property:: top_results :type: list[SearchResult] Get top 3 results by relevance. .. py:class:: SearchResult(/, **data) Bases: :py:obj:`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. .. py:property:: age_days :type: int | None Calculate age of content in days. .. py:property:: is_recent :type: bool Check if content is recent (< 30 days). .. py:class:: SearchSynthesis(/, **data) Bases: :py:obj:`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. .. py:method:: ensure_citations() Ensure citations are provided for summary. .. py:property:: requires_follow_up :type: bool Determine if follow-up search is needed. .. py:property:: total_sources_used :type: int Count total unique sources used.