MCPcopy
hub / github.com/microsoft/agent-lightning / add_resources

Method add_resources

agentlightning/store/base.py:681–697  ·  view source on GitHub ↗

Persist a new immutable snapshot of named resources and mark it as latest. Implementations must assign a fresh `resources_id` and ensure subsequent calls to [`get_latest_resources()`][agentlightning.LightningStore.get_latest_resources] return the snapshot produced here.

(self, resources: NamedResources)

Source from the content-addressed store, hash-verified

679 raise NotImplementedError()
680
681 async def add_resources(self, resources: NamedResources) -> ResourcesUpdate:
682 """Persist a new immutable snapshot of named resources and mark it as latest.
683
684 Implementations must assign a fresh `resources_id` and ensure subsequent calls to
685 [`get_latest_resources()`][agentlightning.LightningStore.get_latest_resources] return the
686 snapshot produced here.
687
688 Args:
689 resources: Mapping of resource names to their serialized payloads.
690
691 Returns:
692 The stored [`ResourcesUpdate`][agentlightning.ResourcesUpdate] including its generated id.
693
694 Raises:
695 NotImplementedError: Subclasses must implement resource persistence.
696 """
697 raise NotImplementedError()
698
699 async def update_resources(self, resources_id: str, resources: NamedResources) -> ResourcesUpdate:
700 """Overwrite or extend an existing resource snapshot and mark it as latest.

Callers 6

stepMethod · 0.45
_async_set_upMethod · 0.45
runMethod · 0.45
sft_one_iterFunction · 0.45
do_sync_trainingFunction · 0.45
apo_algorithmFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected