agents.research.storm.state¶
State management for STORM research workflow.
This module provides Pydantic models for managing state throughout the STORM (Synthesis of Topic Outline through Retrieval and Multi-perspective questioning) research process, including topic definition, article generation, and research coordination.
- Classes:
TopicState: Simple state container for research topic ArticleState: State container for final article content ResearchState: Complete research workflow state management
Example
Basic research state management:
from haive.agents.research.storm.state import ResearchState
state = ResearchState(
topic=TopicState(topic="AI Safety"),
outline=outline_instance,
editors=editor_list,
interview_results=interview_list,
sections=section_list
)
draft = state.draft # Get compiled article draft
Classes¶
State container for final article content. |
|
Complete research workflow state management. |
|
Simple state container for research topic. |
Module Contents¶
- class agents.research.storm.state.ArticleState(/, **data)¶
Bases:
pydantic.BaseModel
State container for final article content.
- Parameters:
data (Any)
- article¶
The complete final article text.
Example
>>> state = ArticleState(article="This is the final article...") >>> print(len(state.article)) 25
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.storm.state.ResearchState(/, **data)¶
Bases:
TopicState
,ArticleState
Complete research workflow state management.
This class manages the entire STORM research process state, including topic definition, outline generation, editor perspectives, interview results, and final section compilation.
- Parameters:
data (Any)
- topic¶
The research topic state container.
- outline¶
Generated outline for the research article.
- editors¶
List of editor perspectives for multi-angle research.
- interview_results¶
Results from perspective-based interviews.
- sections¶
Final compiled sections for the article.
- Properties:
draft: Compiled draft article from all sections.
Example
Complete research workflow:
from haive.agents.research.storm.state import ResearchState state = ResearchState( topic=TopicState(topic="Climate Change"), outline=generated_outline, editors=editor_perspectives, interview_results=interview_data, sections=compiled_sections ) # Get the complete draft article_draft = state.draft print(f"Draft length: {len(article_draft)} characters")
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.storm.state.TopicState(/, **data)¶
Bases:
pydantic.BaseModel
Simple state container for research topic.
- Parameters:
data (Any)
- topic¶
The research topic as a string.
Example
>>> state = TopicState(topic="Machine Learning Ethics") >>> print(state.topic) Machine Learning Ethics
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.