MCPcopy Index your code
hub / github.com/google/adk-python / load_artifact

Method load_artifact

tests/unittests/cli/test_fast_api.py:356–370  ·  view source on GitHub ↗

Load an artifact by filename.

(
        self, app_name, user_id, session_id, filename, version=None
    )

Source from the content-addressed store, hash-verified

354 return version
355
356 async def load_artifact(
357 self, app_name, user_id, session_id, filename, version=None
358 ):
359 """Load an artifact by filename."""
360 key = _artifact_key(app_name, user_id, session_id, filename)
361 if key not in artifacts:
362 return None
363
364 if version is not None:
365 for entry in artifacts[key]:
366 if entry["version"] == version:
367 return entry["artifact"]
368 return None
369
370 return artifacts[key][-1]["artifact"]
371
372 async def list_artifact_keys(self, app_name, user_id, session_id):
373 """List artifact names for a session."""

Calls 1

_artifact_keyFunction · 0.85

Tested by

no test coverage detected