haive.agents.research.open_perplexity.models ============================================ .. py:module:: haive.agents.research.open_perplexity.models .. autoapi-nested-parse:: Models for the open_perplexity research agent. from typing import Any This module defines data models used for representing, tracking, and evaluating research sources, findings, and summaries. It includes enumerations for categorizing data source types, content reliability, freshness, and research depth. Classes ------- .. autoapisummary:: haive.agents.research.open_perplexity.models.ContentFreshness haive.agents.research.open_perplexity.models.ContentReliability haive.agents.research.open_perplexity.models.DataSourceConfig haive.agents.research.open_perplexity.models.DataSourceType haive.agents.research.open_perplexity.models.ResearchDepth haive.agents.research.open_perplexity.models.ResearchFinding haive.agents.research.open_perplexity.models.ResearchSource haive.agents.research.open_perplexity.models.ResearchSummary Module Contents --------------- .. py:class:: ContentFreshness Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enumeration of content freshness levels. Categorizes how recent or up-to-date the information content is. .. attribute:: VERY_RECENT Content from the last few days .. attribute:: RECENT Content from the last few weeks .. attribute:: SOMEWHAT_RECENT Content from the last few months .. attribute:: OUTDATED Content from years ago .. attribute:: UNKNOWN Content with unknown or unclear publication date Initialize self. See help(type(self)) for accurate signature. .. py:class:: ContentReliability Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enumeration of content reliability levels. Categorizes the trustworthiness and reliability of information sources. .. attribute:: HIGH Highly reliable sources (peer-reviewed, authoritative) .. attribute:: MEDIUM Moderately reliable sources (reputable but not authoritative) .. attribute:: LOW Low reliability sources (potentially biased or unverified) .. attribute:: UNKNOWN Sources with unknown or unclear reliability Initialize self. See help(type(self)) for accurate signature. .. py:class:: DataSourceConfig(/, **data) Bases: :py:obj:`pydantic.BaseModel` Configuration for a data source. Specifies parameters for interacting with a particular data source, including API keys and search parameters. .. attribute:: name Name of the data source .. attribute:: source_type Type of data source .. attribute:: enabled Whether this source is enabled .. attribute:: priority Priority (1-10, higher = more important) .. attribute:: api_key API key for the data source if required .. attribute:: max_results Maximum number of results to return .. attribute:: search_params Custom search parameters 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_priority(v) :classmethod: Ensure priority is between 1 and 10. :param v: The priority value to validate :returns: The validated priority value, clamped between 1 and 10 :rtype: int .. py:class:: DataSourceType Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enumeration of data source types. Categorizes the different types of sources where research information can be found. .. attribute:: WEB General web content .. attribute:: GITHUB Code repositories and issues from GitHub .. attribute:: ACADEMIC Academic papers and research publications .. attribute:: NEWS News articles and press releases .. attribute:: SOCIAL_MEDIA Content from social media platforms .. attribute:: DOCUMENTS Uploaded or local documents .. attribute:: API Data retrieved from APIs .. attribute:: OTHER Any other source type not covered above Initialize self. See help(type(self)) for accurate signature. .. py:class:: ResearchDepth Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enumeration of research depth levels. Categorizes the comprehensiveness and thoroughness of the research. .. attribute:: SUPERFICIAL Basic overview with minimal sources .. attribute:: INTERMEDIATE Moderate depth with several sources .. attribute:: DEEP In-depth research with many high-quality sources .. attribute:: COMPREHENSIVE Exhaustive research with extensive sources Initialize self. See help(type(self)) for accurate signature. .. py:class:: ResearchFinding(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for a specific research finding. Represents an individual insight or finding from the research, including supporting sources and confidence assessment. .. attribute:: finding The actual finding or insight .. attribute:: confidence Confidence level in this finding (0.0 - 1.0) .. attribute:: sources Sources supporting this finding .. attribute:: explanation Explanation of the finding's significance .. attribute:: related_findings Related findings 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_confidence(v) :classmethod: Ensure confidence is between 0 and 1. :param v: The confidence value to validate :returns: The validated confidence value, clamped between 0.0 and 1.0 :rtype: float .. py:class:: ResearchSource(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for tracking and evaluating research sources. Represents a source of information used in research, including metadata about its reliability, relevance, and content. .. attribute:: url URL of the source .. attribute:: title Title of the source .. attribute:: source_type Type of data source .. attribute:: content_snippet Snippet of relevant content .. attribute:: reliability Assessed reliability of the source .. attribute:: freshness Content freshness/recency .. attribute:: relevance_score Relevance score from 0.0 to 1.0 .. attribute:: citation Formatted citation for the source .. attribute:: access_timestamp When the source was accessed 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_relevance_score(v) :classmethod: Ensure relevance score is between 0 and 1. :param v: The relevance score to validate :returns: The validated relevance score, clamped between 0.0 and 1.0 :rtype: float .. py:class:: ResearchSummary(/, **data) Bases: :py:obj:`pydantic.BaseModel` Summary of research findings and assessment. Provides an overall summary of the research, including key findings, assessment of source quality, and confidence evaluation. .. attribute:: topic Research topic .. attribute:: question Specific research question .. attribute:: key_findings Key findings from research .. attribute:: sources_count Total number of sources consulted .. attribute:: high_reliability_sources Number of high reliability sources .. attribute:: recent_sources Number of recent sources .. attribute:: research_depth Overall research depth .. attribute:: contradictions Contradictory findings identified .. attribute:: confidence_score Overall confidence score .. attribute:: limitations Research limitations 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:: assess_depth() Assess research depth based on source counts and diversity. Evaluates the depth of research based on the number of sources and the proportion of high reliability sources. :returns: The assessed research depth level :rtype: ResearchDepth .. py:method:: validate_confidence_score(v) :classmethod: Ensure confidence score is between 0 and 1. :param v: The confidence score to validate :returns: The validated confidence score, clamped between 0.0 and 1.0 :rtype: float