Skip to content

Synthesis context

Defines the context object for response synthesis strategies.

Authors

Henry Wicaksono (henry.wicaksono@gdplabs.id)

References

NONE

SynthesisContext

Bases: BaseModel

Context object that encapsulates all parameters needed for response synthesis.

This class provides a clean, type-safe way to pass parameters to synthesis strategies, avoiding the need for multiple optional parameters in method signatures. Each strategy can extract only the parameters it needs from the context.

Attributes:

Name Type Description
query str

The input query.

chunks list[Chunk]

The list of chunks to be used as context.

history list[Message] | None

The conversation history.

extra_contents list[MessageContent] | None

A list of extra contents.

hyperparameters dict[str, Any] | None

The hyperparameters to be passed to the language model.

event_emitter EventEmitter | None

The event emitter for handling events during response synthesis.

kwargs dict[str, Any]

Additional keyword arguments that may be used by specific strategy implementations.