Skip to content

History processor configuration

sweagent.agent.history_processors.DefaultHistoryProcessor pydantic-model

Bases: BaseModel

Config:

  • extra: 'forbid'

Fields:

  • type (Literal['default'])

type pydantic-field

type: Literal['default'] = 'default'

Do not change. Used for (de)serialization.

sweagent.agent.history_processors.LastNObservations pydantic-model

Bases: BaseModel

Keep the last n observations.

Config:

  • extra: 'forbid'

Fields:

always_keep_output_for_tags pydantic-field

always_keep_output_for_tags: set[str] = {'keep_output'}

Any observation with a tags field containing one of these strings will be kept, even if it is not one of the last n observations.

always_remove_output_for_tags pydantic-field

always_remove_output_for_tags: set[str] = {'remove_output'}

Any observation with a tags field containing one of these strings will be elided, even if it is one of the last n observations.

n pydantic-field

n: int

Number of observations to keep.

type pydantic-field

type: Literal['last_n_observations'] = 'last_n_observations'

Do not change. Used for (de)serialization.

sweagent.agent.history_processors.TagToolCallObservations pydantic-model

Bases: BaseModel

Adds tags to history items for specific tool calls.

Config:

  • extra: 'forbid'

Fields:

function_names pydantic-field

function_names: set[str]

Only consider observations made by tools with these names.

tags pydantic-field

tags: set[str] = {'keep_output'}

Add the following tag to all observations matching the search criteria.

type pydantic-field

type: Literal['tag_tool_call_observations'] = 'tag_tool_call_observations'

Do not change. Used for (de)serialization.