Documentation
¶
Overview ¶
Package controllers contains the controllers for the ADK REST API.
Index ¶
- func EncodeJSONResponse(i any, status int, w http.ResponseWriter)
- func NewErrorHandler(fn errorHandler) http.HandlerFunc
- func Unimplemented(rw http.ResponseWriter, req *http.Request)
- type AppsAPIController
- type ArtifactsAPIController
- func (c *ArtifactsAPIController) DeleteArtifactHandler(rw http.ResponseWriter, req *http.Request)
- func (c *ArtifactsAPIController) ListArtifactsHandler(rw http.ResponseWriter, req *http.Request)
- func (c *ArtifactsAPIController) LoadArtifactHandler(rw http.ResponseWriter, req *http.Request)
- func (c *ArtifactsAPIController) LoadArtifactVersionHandler(rw http.ResponseWriter, req *http.Request)
- type DebugAPIController
- type RuntimeAPIController
- type SessionsAPIController
- func (c *SessionsAPIController) CreateSessionHandler(rw http.ResponseWriter, req *http.Request)
- func (c *SessionsAPIController) DeleteSessionHandler(rw http.ResponseWriter, req *http.Request)
- func (c *SessionsAPIController) GetSessionHandler(rw http.ResponseWriter, req *http.Request)
- func (c *SessionsAPIController) ListSessionsHandler(rw http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeJSONResponse ¶
func EncodeJSONResponse(i any, status int, w http.ResponseWriter)
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func NewErrorHandler ¶
func NewErrorHandler(fn errorHandler) http.HandlerFunc
NewErrorHandler writes the error code returned from the http handler. It uses trackingResponseWriter to prevent "superfluous WriteHeader" errors when handlers return errors after already starting to write a response (e.g., SSE streaming).
func Unimplemented ¶
func Unimplemented(rw http.ResponseWriter, req *http.Request)
Unimplemented returns 501 - Status Not Implemented error
Types ¶
type AppsAPIController ¶
type AppsAPIController struct {
// contains filtered or unexported fields
}
AppsAPIController is the controller for the Apps API.
func NewAppsAPIController ¶
func NewAppsAPIController(agentLoader agent.Loader) *AppsAPIController
NewAppsAPIController creates a controller for Apps API.
func (*AppsAPIController) ListAppsHandler ¶
func (c *AppsAPIController) ListAppsHandler(rw http.ResponseWriter, req *http.Request)
ListAppsHandler handles listing all loaded agents.
type ArtifactsAPIController ¶
type ArtifactsAPIController struct {
// contains filtered or unexported fields
}
ArtifactsAPIController is the controller for the Artifacts API.
func NewArtifactsAPIController ¶
func NewArtifactsAPIController(artifactService artifact.Service) *ArtifactsAPIController
func (*ArtifactsAPIController) DeleteArtifactHandler ¶
func (c *ArtifactsAPIController) DeleteArtifactHandler(rw http.ResponseWriter, req *http.Request)
DeleteArtifactHandler handles deleting an artifact.
func (*ArtifactsAPIController) ListArtifactsHandler ¶
func (c *ArtifactsAPIController) ListArtifactsHandler(rw http.ResponseWriter, req *http.Request)
ListArtifactsHandler lists all the artifact filenames within a session.
func (*ArtifactsAPIController) LoadArtifactHandler ¶
func (c *ArtifactsAPIController) LoadArtifactHandler(rw http.ResponseWriter, req *http.Request)
LoadArtifactHandler gets an artifact from the artifact service storage.
func (*ArtifactsAPIController) LoadArtifactVersionHandler ¶
func (c *ArtifactsAPIController) LoadArtifactVersionHandler(rw http.ResponseWriter, req *http.Request)
LoadArtifactVersionHandler gets an artifact from the artifact service storage with specified version.
type DebugAPIController ¶
type DebugAPIController struct {
// contains filtered or unexported fields
}
DebugAPIController is the controller for the Debug API.
func NewDebugAPIController ¶
func NewDebugAPIController(sessionService session.Service, agentLoader agent.Loader, spansExporter *services.APIServerSpanExporter) *DebugAPIController
NewDebugAPIController creates the controller for the Debug API.
func (*DebugAPIController) EventGraphHandler ¶
func (c *DebugAPIController) EventGraphHandler(rw http.ResponseWriter, req *http.Request)
EventGraphHandler returns the debug information for the session and session events in form of graph.
func (*DebugAPIController) TraceDictHandler ¶
func (c *DebugAPIController) TraceDictHandler(rw http.ResponseWriter, req *http.Request)
TraceDictHandler returns the debug information for the session in form of dictionary.
type RuntimeAPIController ¶
type RuntimeAPIController struct {
// contains filtered or unexported fields
}
RuntimeAPIController is the controller for the Runtime API.
func NewRuntimeAPIController ¶
func NewRuntimeAPIController(sessionService session.Service, memoryService memory.Service, agentLoader agent.Loader, artifactService artifact.Service, sseTimeout time.Duration, pluginConfig runner.PluginConfig) *RuntimeAPIController
NewRuntimeAPIController creates the controller for the Runtime API.
func (*RuntimeAPIController) RunHandler ¶
func (c *RuntimeAPIController) RunHandler(rw http.ResponseWriter, req *http.Request) error
RunAgent executes a non-streaming agent run for a given session and message.
func (*RuntimeAPIController) RunSSEHandler ¶
func (c *RuntimeAPIController) RunSSEHandler(rw http.ResponseWriter, req *http.Request) error
RunSSEHandler executes an agent run and streams the resulting events using Server-Sent Events (SSE).
type SessionsAPIController ¶
type SessionsAPIController struct {
// contains filtered or unexported fields
}
SessionsAPIController is the controller for the Sessions API.
func NewSessionsAPIController ¶
func NewSessionsAPIController(service session.Service) *SessionsAPIController
NewSessionsAPIController creates a new SessionsAPIController.
func (*SessionsAPIController) CreateSessionHandler ¶
func (c *SessionsAPIController) CreateSessionHandler(rw http.ResponseWriter, req *http.Request)
CreateSesssionHTTP is a HTTP handler for the create session API.
func (*SessionsAPIController) DeleteSessionHandler ¶
func (c *SessionsAPIController) DeleteSessionHandler(rw http.ResponseWriter, req *http.Request)
DeleteSession handles deleting a specific session.
func (*SessionsAPIController) GetSessionHandler ¶
func (c *SessionsAPIController) GetSessionHandler(rw http.ResponseWriter, req *http.Request)
GetSession retrieves a specific session by its ID.
func (*SessionsAPIController) ListSessionsHandler ¶
func (c *SessionsAPIController) ListSessionsHandler(rw http.ResponseWriter, req *http.Request)
ListSessions handles listing all sessions for a given app and user.