Documentation
¶
Index ¶
- Constants
- func AgentRunResponseUpdatesEqual(expected, actual []*agent.ResponseUpdate) error
- func CreateSession(options ...agent.Option) *agent.Session
- func EncodeContinuationToken(t testing.TB, token ContinuationToken) string
- func MessagesEqual(expected, actual []*message.Message) error
- func New(responses []Turn) *agent.Agent
- func NewContinuationToken(t testing.TB, innerToken string) string
- func ResponseUpdateEqual(got, want *agent.ResponseUpdate) error
- func ResponseUpdatesEqual(got, want []*agent.ResponseUpdate) error
- type ContinuationToken
- type Middleware
- type Response
- type ResponseBuilder
- func (rb *ResponseBuilder) Add(resp *agent.ResponseUpdate) *ResponseBuilder
- func (rb *ResponseBuilder) AddError(err error) *ResponseBuilder
- func (rb *ResponseBuilder) AddFunctionCall(callID, name string, arguments string) *ResponseBuilder
- func (rb *ResponseBuilder) AddText(text string) *ResponseBuilder
- func (rb *ResponseBuilder) Build() []Turn
- func (rb *ResponseBuilder) NewTurn(...) *ResponseBuilder
- type Runner
- type Tool
- type Turn
Constants ¶
View Source
const ContinuationTokenType = "agentContinuationToken"
Variables ¶
This section is empty.
Functions ¶
func AgentRunResponseUpdatesEqual ¶
func AgentRunResponseUpdatesEqual(expected, actual []*agent.ResponseUpdate) error
func EncodeContinuationToken ¶
func EncodeContinuationToken(t testing.TB, token ContinuationToken) string
func MessagesEqual ¶
func ResponseUpdateEqual ¶
func ResponseUpdateEqual(got, want *agent.ResponseUpdate) error
func ResponseUpdatesEqual ¶
func ResponseUpdatesEqual(got, want []*agent.ResponseUpdate) error
Types ¶
type ContinuationToken ¶
type ContinuationToken struct {
Type string `json:"type"`
InnerToken string `json:"innerToken"`
InputMessages []*message.Message `json:"inputMessages,omitempty"`
ResponseUpdates []*agent.ResponseUpdate `json:"responseUpdates,omitempty"`
}
func DecodeContinuationToken ¶
func DecodeContinuationToken(t testing.TB, token string) ContinuationToken
type Middleware ¶
type Middleware struct {
PreResponses []Turn
PostResponses []Turn
// contains filtered or unexported fields
}
Middleware is a test implementation of the Middleware interface
func (*Middleware) Called ¶
func (m *Middleware) Called() bool
type Response ¶
type Response struct {
Response *agent.ResponseUpdate
Error error
}
type ResponseBuilder ¶
type ResponseBuilder struct {
// contains filtered or unexported fields
}
func NewResponseBuilder ¶
func (*ResponseBuilder) Add ¶
func (rb *ResponseBuilder) Add(resp *agent.ResponseUpdate) *ResponseBuilder
func (*ResponseBuilder) AddError ¶
func (rb *ResponseBuilder) AddError(err error) *ResponseBuilder
func (*ResponseBuilder) AddFunctionCall ¶
func (rb *ResponseBuilder) AddFunctionCall(callID, name string, arguments string) *ResponseBuilder
func (*ResponseBuilder) AddText ¶
func (rb *ResponseBuilder) AddText(text string) *ResponseBuilder
func (*ResponseBuilder) Build ¶
func (rb *ResponseBuilder) Build() []Turn
func (*ResponseBuilder) NewTurn ¶
func (rb *ResponseBuilder) NewTurn(callbacks ...func(ctx context.Context, messages []*message.Message, opts ...agent.Option)) *ResponseBuilder
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool is a test implementation of the Tool interface
func (*Tool) Description ¶
Click to show internal directories.
Click to hide internal directories.