agents.research.open_perplexity.stateΒΆ

State schemas for the open_perplexity research agent.

This module defines the state schemas used by the research agent to track the progress of research, manage search queries, store sources, and generate reports. It includes schemas for input, processing state, and output.

ClassesΒΆ

ReportSection

Represents a section in the research report.

ResearchConfidenceLevel

Confidence level in research findings.

ResearchInputState

Input state for the research process.

ResearchOutputState

Output state for the research process.

ResearchState

State schema for the open_perplexity research agent.

WebSearchQuery

Represents a web search query for retrieving information.

Module ContentsΒΆ

class agents.research.open_perplexity.state.ReportSection(/, **data)ΒΆ

Bases: pydantic.BaseModel

Represents a section in the research report.

Tracks a single report section, including its content, research needs, and associated queries and sources.

Parameters:

data (Any)

nameΒΆ

Section name

descriptionΒΆ

Section description

contentΒΆ

Section content

requires_researchΒΆ

Whether this section requires research

queriesΒΆ

Search queries for this section

sourcesΒΆ

Sources used in this section

statusΒΆ

Section status (pending, in_progress, completed)

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.

class agents.research.open_perplexity.state.ResearchConfidenceLevelΒΆ

Bases: str, enum.Enum

Confidence level in research findings.

Represents the overall confidence level in the research results, based on source quality, quantity, and consistency.

HIGHΒΆ

High confidence based on numerous reliable sources

MEDIUMΒΆ

Medium confidence with good but limited sources

LOWΒΆ

Low confidence due to limited or questionable sources

INSUFFICIENT_DATAΒΆ

Not enough data to establish confidence

Initialize self. See help(type(self)) for accurate signature.

class agents.research.open_perplexity.state.ResearchInputState(/, **data)ΒΆ

Bases: pydantic.BaseModel

Input state for the research process.

Represents the initial input to the research agent, including the user’s query and any additional context.

Parameters:

data (Any)

messagesΒΆ

Input messages including user query

input_contextΒΆ

Additional context provided for the research

research_parametersΒΆ

Optional parameters to customize the research process

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.

class agents.research.open_perplexity.state.ResearchOutputState(/, **data)ΒΆ

Bases: pydantic.BaseModel

Output state for the research process.

Represents the final output from the research agent, including the completed report and confidence assessment.

Parameters:

data (Any)

final_reportΒΆ

Complete research report in markdown format

confidence_levelΒΆ

Confidence level in the research findings

sourcesΒΆ

Sources used in the research

messagesΒΆ

Conversation history including the assistant’s final response

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.

class agents.research.open_perplexity.state.ResearchState(/, **data)ΒΆ

Bases: pydantic.BaseModel

State schema for the open_perplexity research agent.

Comprehensive state object that tracks all aspects of the research process, including messages, research parameters, report sections, sources, and findings.

Parameters:

data (Any)

messagesΒΆ

Conversation messages

research_topicΒΆ

Main topic of research

research_questionΒΆ

Specific research question

input_contextΒΆ

Additional context provided by the user

search_parametersΒΆ

Parameters for search and research customization

report_sectionsΒΆ

Sections of the research report

current_section_indexΒΆ

Index of the current section being researched

search_queriesΒΆ

List of search queries to execute

queryΒΆ

Current search query

retrieved_documentsΒΆ

Documents retrieved from search

sourcesΒΆ

Sources used in the research

data_sourcesΒΆ

Data sources available and used

vectorstore_documentsΒΆ

Documents loaded into vector store

research_findingsΒΆ

Key findings from the research

confidence_levelΒΆ

Overall confidence level in research findings

confidence_explanationΒΆ

Explanation for the confidence level assessment

final_reportΒΆ

Final research report content

current_stepΒΆ

Current step in the workflow

errorΒΆ

Error message if any step fails

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.

class agents.research.open_perplexity.state.WebSearchQuery(/, **data)ΒΆ

Bases: pydantic.BaseModel

Represents a web search query for retrieving information.

Tracks a single search query, its purpose, execution status, and results.

Parameters:

data (Any)

queryΒΆ

The search query text

purposeΒΆ

Purpose of this search query

data_sourceΒΆ

Data source to query (web, github, academic, news, etc.)

completedΒΆ

Whether this query has been executed

resultsΒΆ

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.