Experimental

The names in mistralai.agents.experimental, and the warning some features give. A minor release may change them, with a changelog line that starts "Experimental:"; a patch release does not.

NameWhat it is
ExperimentalWarningA call was given an experimental keyword: a minor release may change or remove it.
experimental.JsonFileSessionJournalThe JSON file that saves one local root session.
ExperimentalWarning

ExperimentalWarning

class ExperimentalWarning(UserWarning)

A call was given an experimental keyword: a minor release may change or remove it.

Each keyword warns once per process. Hide them all with AGENTS_SDK_EXPERIMENTAL_WARNINGS=0, or in code with warnings.filterwarnings("ignore", category=agents.ExperimentalWarning).

experimental.JsonFileSessionJournal

experimental.JsonFileSessionJournal

class JsonFileSessionJournal(path: str | PathLike[str])

The JSON file that saves one local root session. Experimental: a minor release may change it.

Pass JsonFileSessionJournal.in_directory("./sessions") as journal_factory= to agents.local_runtime(), and each root session of the block is saved in ./sessions/<session id>/. A later process with the same agent and the same directory continues it with agent.session(session_id). An agent.run() in the block saves its session too. The factory is fixed when the event loop's runtime starts: entering a block with another one while the runtime runs raises SdkError.

The uploads that its messages linked are saved next to the file, in <file stem>.files.

ParameterTypeDefaultDescription
pathstr | PathLike[str]requiredThe JSON file of the session.
AttributeTypeDescription
pathPathThe JSON file of the session.
experimental.JsonFileSessionJournal.in_directory

experimental.JsonFileSessionJournal.in_directory

@classmethod
def in_directory(
    directory: str | PathLike[str],
) -> Callable[[str], experimental.JsonFileSessionJournal]

Return the journal_factory that saves each session in directory/<session id>/session.json.

ParameterTypeDefaultDescription
directorystr | PathLike[str]requiredThe folder that holds the saved sessions.