Documentation
¶
Index ¶
- func StateKeyFromContext(ctx context.Context) (string, bool)
- func WithStateKey(ctx context.Context, key string) context.Context
- type Agent
- type Cache
- type FormFlow
- type FormSpec
- type HistoryReadWriter
- type HistoryStore
- func (s *HistoryStore) Append(ctx context.Context, msgs ...*schema.Message) ([]*schema.Message, error)
- func (s *HistoryStore) Clear(ctx context.Context) error
- func (s *HistoryStore) Load(ctx context.Context) ([]*schema.Message, error)
- func (s *HistoryStore) Save(ctx context.Context, history []*schema.Message) error
- type KeepSystemLastNTrimmer
- type MemoryCache
- func (m *MemoryCache[S]) Del(ctx context.Context, key string) error
- func (m *MemoryCache[S]) Exists(ctx context.Context, key string) (bool, error)
- func (m *MemoryCache[S]) Get(ctx context.Context, key string) (S, bool, error)
- func (m *MemoryCache[S]) Set(ctx context.Context, key string, val S) error
- type Option
- type Request
- type Response
- type State
- type StateReadWriter
- type StateStore
- type Store
- type Trimmer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent[T any] struct { // contains filtered or unexported fields }
func (*Agent[T]) Run ¶
func (a *Agent[T]) Run(ctx context.Context, input *adk.AgentInput, options ...adk.AgentRunOption) *adk.AsyncIterator[*adk.AgentEvent]
type FormFlow ¶
type FormFlow[T any] struct { // contains filtered or unexported fields }
func NewFormFlow ¶
func NewToolBasedFormFlow ¶
type HistoryReadWriter ¶
type HistoryReadWriter interface {
Load(ctx context.Context) ([]*schema.Message, error)
Save(ctx context.Context, history []*schema.Message) error
Clear(ctx context.Context) error
// Append loads history, appends msgs with de-duplication, trims, then saves.
// It returns the saved history for convenient passing to adk.AgentInput.
Append(ctx context.Context, msgs ...*schema.Message) ([]*schema.Message, error)
}
type HistoryStore ¶
type HistoryStore struct {
// contains filtered or unexported fields
}
func NewHistoryStore ¶
func NewHistoryStore(core Cache[[]*schema.Message], trimmer Trimmer) *HistoryStore
func NewMemoryHistoryStore ¶
func NewMemoryHistoryStore(trimmer Trimmer) *HistoryStore
type KeepSystemLastNTrimmer ¶
type KeepSystemLastNTrimmer struct {
N int
}
KeepSystemLastNTrimmer keeps all system messages and the last N non-system messages. When N <= 0, it keeps only system messages.
type MemoryCache ¶
type MemoryCache[S any] struct { // contains filtered or unexported fields }
func NewMemoryCore ¶
func NewMemoryCore[S any]() *MemoryCache[S]
type State ¶
type State[T any] struct { Phase types.Phase `` /* 145-byte string literal not displayed */ LatestQuestion string `json:"latest_question" jsonschema:"description=The latest question asked to the user"` FormState T `json:"form_state" jsonschema:"description=The current state of the form being filled"` }
type StateReadWriter ¶
type StateStore ¶
type StateStore[T any] struct { // contains filtered or unexported fields }
func NewMemoryStateStore ¶
func NewMemoryStateStore[T any](stateInit func(ctx context.Context) T) *StateStore[T]
func NewStateStore ¶
Click to show internal directories.
Click to hide internal directories.