agents.reasoning_and_critique.self_discover.self_discover_simple_v4

Self-Discover Simple V4 - Minimal implementation with proper state handling.

This version: - Uses a single shared state dict - Each agent updates the state with its output - No complex state transformations - Clear, simple flow

Classes

AdaptedModules

Adapted modules output.

ModuleList

Selected modules output.

Plan

Reasoning plan output.

Solution

Final solution output.

Functions

create_agents()

Create the four agents for Self-Discover.

create_self_discover_simple()

Create the Self-Discover agent.

main()

Main.

run_self_discover(task[, modules])

Run Self-Discover on a task.

Module Contents

class agents.reasoning_and_critique.self_discover.self_discover_simple_v4.AdaptedModules(/, **data)

Bases: pydantic.BaseModel

Adapted modules output.

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.

Parameters:

data (Any)

class agents.reasoning_and_critique.self_discover.self_discover_simple_v4.ModuleList(/, **data)

Bases: pydantic.BaseModel

Selected modules output.

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.

Parameters:

data (Any)

class agents.reasoning_and_critique.self_discover.self_discover_simple_v4.Plan(/, **data)

Bases: pydantic.BaseModel

Reasoning plan output.

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.

Parameters:

data (Any)

class agents.reasoning_and_critique.self_discover.self_discover_simple_v4.Solution(/, **data)

Bases: pydantic.BaseModel

Final solution output.

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.

Parameters:

data (Any)

agents.reasoning_and_critique.self_discover.self_discover_simple_v4.create_agents()

Create the four agents for Self-Discover.

agents.reasoning_and_critique.self_discover.self_discover_simple_v4.create_self_discover_simple()

Create the Self-Discover agent.

async agents.reasoning_and_critique.self_discover.self_discover_simple_v4.main()

Main.

async agents.reasoning_and_critique.self_discover.self_discover_simple_v4.run_self_discover(task, modules=None)

Run Self-Discover on a task.

Parameters:
  • task (str) – The task to solve

  • modules (str | None) – Optional custom modules (defaults to MODULES)

Returns:

Dict with the solution