11package api
22
33import (
4+ "fmt"
5+
46 "github.com/labstack/echo/v4"
7+ "google.golang.org/adk/artifact"
8+ "google.golang.org/adk/model"
59 "google.golang.org/adk/session"
610
711 "github.com/hofstadter-io/hof/lib/agent/config"
12+ "github.com/hofstadter-io/hof/lib/agent/runtime/handlers/common"
813)
914
1015type Runtime struct {
@@ -13,6 +18,34 @@ type Runtime struct {
1318 Agentic * config.Config
1419}
1520
21+ func (r * Runtime ) GetAppName () string {
22+ return r .AppName
23+ }
24+
25+ func (r * Runtime ) GetSessionService () session.Service {
26+ return r .S
27+ }
28+
29+ func (r * Runtime ) GetAgenticConfig () * config.Config {
30+ return r .Agentic
31+ }
32+
33+ func (r * Runtime ) GetArtifactService () artifact.Service {
34+ return nil
35+ }
36+
37+ func (r * Runtime ) GetModels () map [string ]model.LLM {
38+ return nil
39+ }
40+
41+ func (r * Runtime ) ReadEnvConfig () error {
42+ return fmt .Errorf ("ReadEnvConfig not implemented for api.Runtime" )
43+ }
44+
45+ func (r * Runtime ) SetSession (s * common.Session ) {
46+ // api doesn't track active sessions this way
47+ }
48+
1649func Setup (appName string , e * echo.Echo , s session.Service , a * config.Config ) (* Runtime , error ) {
1750 r := & Runtime {
1851 AppName : appName ,
@@ -36,8 +69,15 @@ func Setup(appName string, e *echo.Echo, s session.Service, a *config.Config) (*
3669 e .POST ("/env/list" , envList )
3770 e .POST ("/prompt/render" , r .promptRender )
3871
72+ e .POST ("/session/list" , r .sessionList )
73+ e .POST ("/session/get" , r .sessionGet )
74+ e .POST ("/session/create" , r .sessionCreate )
75+ e .POST ("/session/delete" , r .sessionDelete )
3976 e .POST ("/session/clone" , r .sessionClone )
4077 e .POST ("/session/splice" , r .sessionSplice )
78+ e .POST ("/session/state/get" , r .sessionStateGet )
79+ e .POST ("/session/state/put" , r .sessionStatePut )
80+ e .POST ("/session/state/del" , r .sessionStateDel )
4181
4282 return r , nil
4383}
0 commit comments