类:ArtifactController
java.lang.Object
com.google.adk.web.controller.ArtifactController
控制器负责处理与工件(artifact)相关的 API 端点。
-
构造函数概述
Constructors -
方法概述
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> deleteArtifact(String appName, String userId, String sessionId, String artifactName) 删除某个工件(artifact)及其所有版本。listArtifactNames(String appName, String userId, String sessionId) 列出与某个会话关联的所有工件的名称。listArtifactVersions(String appName, String userId, String sessionId, String artifactName) 列出特定软件产品的可用版本。com.google.genai.types.Part加载与某个会话相关联的最新版本或特定版本的工件(artifact)。com.google.genai.types.PartloadArtifactVersion(String appName, String userId, String sessionId, String artifactName, int versionId) 加载某个特定版本的工件(artifact)。
-
构造函数详细信息
-
ArtifactController
-
-
方法详细信息(Method Details)
-
loadArtifact
@GetMapping("/apps/{appName}/users/{userId}/sessions/{sessionId}/artifacts/{artifactName}") public com.google.genai.types.Part loadArtifact(@PathVariable String appName, @PathVariable String userId, @PathVariable String sessionId, @PathVariable String artifactName, @RequestParam(required=false) Integer version) 加载与某个会话相关联的最新版本或特定版本的工件(artifact)。- Parameters:
appName- The application name.userId- The user ID.sessionId- The session ID.artifactName- The name of the artifact.version- Optional specific version number. If null, loads the latest.- Returns:
- The artifact content as a Part object.
- Throws:
org.springframework.web.server.ResponseStatusException- if the artifact is not found (NOT_FOUND).
-
loadArtifactVersion
@GetMapping("/apps/{appName}/users/{userId}/sessions/{sessionId}/artifacts/{artifactName}/versions/{versionId}") public com.google.genai.types.Part loadArtifactVersion(@PathVariable String appName, @PathVariable String userId, @PathVariable String sessionId, @PathVariable String artifactName, @PathVariable int versionId) 加载某个特定版本的工件(artifact)。- Parameters:
appName- The application name.userId- The user ID.sessionId- The session ID.artifactName- The name of the artifact.versionId- The specific version number.- Returns:
- The artifact content as a Part object.
- Throws:
org.springframework.web.server.ResponseStatusException- if the artifact version is not found (NOT_FOUND).
-
listArtifactNames
@GetMapping("/apps/{appName}/users/{userId}/sessions/{sessionId}/artifacts") public List<String> listArtifactNames(@PathVariable String appName, @PathVariable String userId, @PathVariable String sessionId) 列出与某个会话关联的所有工件的名称。- Parameters:
appName- The application name.userId- The user ID.sessionId- The session ID.- Returns:
- A list of artifact names.
-
listArtifactVersions
@GetMapping("/apps/{appName}/users/{userId}/sessions/{sessionId}/artifacts/{artifactName}/versions") public List<Integer> listArtifactVersions(@PathVariable String appName, @PathVariable String userId, @PathVariable String sessionId, @PathVariable String artifactName) 列出特定软件产品的可用版本。- Parameters:
appName- The application name.userId- The user ID.sessionId- The session ID.artifactName- The name of the artifact.- Returns:
- A list of version numbers (integers).
-
deleteArtifact
@DeleteMapping("/apps/{appName}/users/{userId}/sessions/{sessionId}/artifacts/{artifactName}") public org.springframework.http.ResponseEntity<Void> deleteArtifact(@PathVariable String appName, @PathVariable String userId, @PathVariable String sessionId, @PathVariable String artifactName) 删除某个工件(artifact)及其所有版本。- Parameters:
appName- The application name.userId- The user ID.sessionId- The session ID.artifactName- The name of the artifact to delete.- Returns:
- A ResponseEntity with status NO_CONTENT on success.
- Throws:
org.springframework.web.server.ResponseStatusException- if deletion fails (INTERNAL_SERVER_ERROR).
-