# Interface BaseArtifactService

All Known Implementing Classes:
  `GcsArtifactService, InMemoryArtifactService`

public interface BaseArtifactService
Base interface for artifact services.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default io.reactivex.rxjava3.core.Completable`
  `deleteArtifact(SessionKey sessionKey, String filename)`
  `io.reactivex.rxjava3.core.Completable`
  `deleteArtifact(String appName, String userId, String sessionId, String filename)`
  Deletes an artifact.
  `default io.reactivex.rxjava3.core.Single<ListArtifactsResponse>`
  `listArtifactKeys(SessionKey sessionKey)`
  `io.reactivex.rxjava3.core.Single<ListArtifactsResponse>`
  `listArtifactKeys(String appName, String userId, String sessionId)`
  Lists all the artifact filenames within a session.
  `default io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<Integer>>`
  `listVersions(SessionKey sessionKey, String filename)`
  `io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<Integer>>`
  `listVersions(String appName, String userId, String sessionId, String filename)`
  Lists all the versions (as revision IDs) of an artifact.
  `default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part>`
  `loadArtifact(SessionKey sessionKey, String filename)`
  Loads the latest version of an artifact from the service.
  `default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part>`
  `loadArtifact(SessionKey sessionKey, String filename, int version)`
  `default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part>`
  `loadArtifact(String appName, String userId, String sessionId, String filename)`
  Loads the latest version of an artifact from the service.
  `default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part>`
  `loadArtifact(String appName, String userId, String sessionId, String filename, int version)`
  Loads a specific version of an artifact from the service.
  `io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part>`
  `loadArtifact(String appName, String userId, String sessionId, String filename, @Nullable Integer version)`
  `default io.reactivex.rxjava3.core.Single<com.google.genai.types.Part>`
  `saveAndReloadArtifact(SessionKey sessionKey, String filename, com.google.genai.types.Part artifact)`
  Saves an artifact and returns it with fileData if available.
  `default io.reactivex.rxjava3.core.Single<com.google.genai.types.Part>`
  `saveAndReloadArtifact(String appName, String userId, String sessionId, String filename, com.google.genai.types.Part artifact)`
  Saves an artifact and returns it with fileData if available.
  `default io.reactivex.rxjava3.core.Single<Integer>`
  `saveArtifact(SessionKey sessionKey, String filename, com.google.genai.types.Part artifact)`
  Saves an artifact.
  `io.reactivex.rxjava3.core.Single<Integer>`
  `saveArtifact(String appName, String userId, String sessionId, String filename, com.google.genai.types.Part artifact)`
  Saves an artifact.

- ## Method Details

  - ### saveArtifact

    io.reactivex.rxjava3.core.Single<Integer> saveArtifact(String appName, String userId, String sessionId, String filename, com.google.genai.types.Part artifact)
    Saves an artifact.
    Parameters:
      `appName` - the app name
      `userId` - the user ID
      `sessionId` - the session ID
      `filename` - the filename
      `artifact` - the artifact
    Returns:
      the revision ID (version) of the saved artifact.

  - ### saveArtifact

    default io.reactivex.rxjava3.core.Single<Integer> saveArtifact(SessionKey sessionKey, String filename, com.google.genai.types.Part artifact)
    Saves an artifact.

  - ### saveAndReloadArtifact

    default io.reactivex.rxjava3.core.Single<com.google.genai.types.Part> saveAndReloadArtifact(String appName, String userId, String sessionId, String filename, com.google.genai.types.Part artifact)
    Saves an artifact and returns it with fileData if available.

    Implementations should override this default method for efficiency, as the default performs two I/O operations (save then load).

    Parameters:
      `appName` - the app name
      `userId` - the user ID
      `sessionId` - the session ID
      `filename` - the filename
      `artifact` - the artifact to save
    Returns:
      the saved artifact with fileData if available.

  - ### saveAndReloadArtifact

    default io.reactivex.rxjava3.core.Single<com.google.genai.types.Part> saveAndReloadArtifact(SessionKey sessionKey, String filename, com.google.genai.types.Part artifact)
    Saves an artifact and returns it with fileData if available.

  - ### loadArtifact

    default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part> loadArtifact(String appName, String userId, String sessionId, String filename)
    Loads the latest version of an artifact from the service.

  - ### loadArtifact

    default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part> loadArtifact(SessionKey sessionKey, String filename)
    Loads the latest version of an artifact from the service.

  - ### loadArtifact

    default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part> loadArtifact(String appName, String userId, String sessionId, String filename, int version)
    Loads a specific version of an artifact from the service.

  - ### loadArtifact

    default io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part> loadArtifact(SessionKey sessionKey, String filename, int version)

  - ### loadArtifact

    io.reactivex.rxjava3.core.Maybe<com.google.genai.types.Part> loadArtifact(String appName, String userId, String sessionId, String filename, @Nullable Integer version)

  - ### listArtifactKeys

    io.reactivex.rxjava3.core.Single<ListArtifactsResponse> listArtifactKeys(String appName, String userId, String sessionId)
    Lists all the artifact filenames within a session.
    Parameters:
      `appName` - the app name
      `userId` - the user ID
      `sessionId` - the session ID
    Returns:
      the list artifact response containing filenames

  - ### listArtifactKeys

    default io.reactivex.rxjava3.core.Single<ListArtifactsResponse> listArtifactKeys(SessionKey sessionKey)

  - ### deleteArtifact

    io.reactivex.rxjava3.core.Completable deleteArtifact(String appName, String userId, String sessionId, String filename)
    Deletes an artifact.
    Parameters:
      `appName` - the app name
      `userId` - the user ID
      `sessionId` - the session ID
      `filename` - the filename

  - ### deleteArtifact

    default io.reactivex.rxjava3.core.Completable deleteArtifact(SessionKey sessionKey, String filename)

  - ### listVersions

    io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<Integer>> listVersions(String appName, String userId, String sessionId, String filename)
    Lists all the versions (as revision IDs) of an artifact.
    Parameters:
      `appName` - the app name
      `userId` - the user ID
      `sessionId` - the session ID
      `filename` - the artifact filename
    Returns:
      A list of integer version numbers.

  - ### listVersions

    default io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<Integer>> listVersions(SessionKey sessionKey, String filename)