api

package
v0.0.0-...-52cc1ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package api provides HTTP API server implementation equivalent to Python's fast_api.py

Package api provides web UI functionality for the ADK web server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSessionToEvalSetRequest

type AddSessionToEvalSetRequest struct {
	UserID    string `json:"user_id"`
	SessionID string `json:"session_id"`
	EvalID    string `json:"eval_id"`
}

AddSessionToEvalSetRequest represents a request to add session to eval set

type AgentRunRequest

type AgentRunRequest struct {
	AppName    string        `json:"app_name"`
	UserID     string        `json:"user_id"`
	SessionID  string        `json:"session_id"`
	NewMessage *core.Content `json:"new_message"`
	Streaming  bool          `json:"streaming,omitempty"`
}

AgentRunRequest represents a request to run an agent

type CreateSessionRequest

type CreateSessionRequest struct {
	State  map[string]any `json:"state,omitempty"`
	Events []*core.Event  `json:"events,omitempty"`
}

CreateSessionRequest represents a request to create a session

type ListSessionsResponse

type ListSessionsResponse struct {
	Sessions []*core.Session `json:"sessions"`
}

ListSessionsResponse represents the response for listing sessions

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the HTTP API server

func NewServer

func NewServer(config *ServerConfig) (*Server, error)

NewServer creates a new API server instance

func (*Server) SetupWebRoutes

func (s *Server) SetupWebRoutes()

SetupWebRoutes adds web UI routes to the server

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

type ServerConfig

type ServerConfig struct {
	Host               string
	Port               int
	AgentsDir          string
	SessionServiceURI  string
	ArtifactServiceURI string
	MemoryServiceURI   string
	EvalStorageURI     string
	AllowOrigins       []string
	TraceToCloud       bool
	A2AEnabled         bool
	LogLevel           string
}

ServerConfig contains configuration for the API server

type WebUIHandler

type WebUIHandler struct {
	// contains filtered or unexported fields
}

WebUIHandler provides web UI functionality

func NewWebUIHandler

func NewWebUIHandler(server *Server) *WebUIHandler

NewWebUIHandler creates a new web UI handler

func (*WebUIHandler) HandleIndex

func (w *WebUIHandler) HandleIndex(writer http.ResponseWriter, req *http.Request)

HandleIndex serves the main web UI page

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL