prebuilt.tldr2.engines¶

Engine configurations for the News Research Agent.

This module defines all AugLLMConfig engines used by the news research agent. Each engine represents a specific capability with its own prompt, tools, and structured output model.

Engines are configured with: - Prompt templates for specific tasks - Tools for interacting with external services - Structured output models for type-safe responses - LLM configurations for model selection and parameters

Example

>>> from news_research.engines import search_engine, analysis_engine
>>> result = search_engine.invoke(state)

Note

All engines use structured_output_version=’v2’ for Pydantic v2 compatibility.

Functions¶

create_all_engines()

Create all engines for the news research agent.

create_analysis_engine()

Create the research analysis engine.

create_decision_engine()

Create the search decision engine.

create_extraction_engine()

Create the content extraction coordination engine.

create_report_engine()

Create the report generation engine.

create_search_engine()

Create the search parameter generation engine.

create_selection_engine()

Create the article selection engine.

create_summary_engine()

Create the article summarization engine.

Module Contents¶

prebuilt.tldr2.engines.create_all_engines()¶

Create all engines for the news research agent.

Returns:

Dictionary of all configured engines

Return type:

Dict[str, AugLLMConfig]

Example

>>> engines = create_all_engines()
>>> search_engine = engines["search"]
prebuilt.tldr2.engines.create_analysis_engine()¶

Create the research analysis engine.

This engine analyzes all collected articles to identify themes, patterns, and insights.

Returns:

Configured analysis engine

Return type:

AugLLMConfig

prebuilt.tldr2.engines.create_decision_engine()¶

Create the search decision engine.

This engine decides whether to continue searching for more articles or proceed with analysis based on current results.

Returns:

Configured decision engine

Return type:

AugLLMConfig

prebuilt.tldr2.engines.create_extraction_engine()¶

Create the content extraction coordination engine.

This engine coordinates the extraction of full article content from URLs using the extraction tools.

Returns:

Configured extraction engine

Return type:

AugLLMConfig

prebuilt.tldr2.engines.create_report_engine()¶

Create the report generation engine.

This engine creates the final research report with executive summary, detailed sections, and recommendations.

Returns:

Configured report engine

Return type:

AugLLMConfig

prebuilt.tldr2.engines.create_search_engine()¶

Create the search parameter generation engine.

This engine analyzes the research topic and generates appropriate search parameters for the NewsAPI.

Returns:

Configured search engine

Return type:

AugLLMConfig

Example

>>> engine = create_search_engine()
>>> params = engine.invoke(state)
prebuilt.tldr2.engines.create_selection_engine()¶

Create the article selection engine.

This engine analyzes article metadata and content to select the most relevant articles for summarization.

Returns:

Configured selection engine

Return type:

AugLLMConfig

prebuilt.tldr2.engines.create_summary_engine()¶

Create the article summarization engine.

This engine generates concise, informative summaries of articles with key points and relevance scores.

Returns:

Configured summary engine

Return type:

AugLLMConfig