Documentation
¶
Index ¶
- func GetPromptFn(promptValues *ChatPromptValues) ai.PromptFn
- type Action
- type AvailableAction
- type ChatPromptValues
- type Conversation
- type Engine
- func (s *Engine) BuildPromptValues(ctx context.Context, agent entity.Agent, history []Conversation, thread Thread) (*ChatPromptValues, error)
- func (e *Engine) Embed(ctx context.Context, texts ...string) ([][]float32, error)
- func (e *Engine) Generate(ctx context.Context, req *GenerateRequest, out any, opts ...ai.GenerateOption) (*ai.ModelResponse, error)
- func (s *Engine) Run(ctx context.Context, agent entity.Agent, req RunRequest, output any) (*RunResponse, error)
- type EvaluatorResponse
- type GenerateRequest
- type Participant
- type RunRequest
- type RunResponse
- type Thread
- type ToolCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPromptFn ¶
func GetPromptFn(promptValues *ChatPromptValues) ai.PromptFn
Types ¶
type AvailableAction ¶
type ChatPromptValues ¶
type ChatPromptValues struct {
Agent entity.Agent
RecentConversations []Conversation
AvailableActions []AvailableAction
MessageExamples [][]entity.MessageExample
Thread Thread
Tools []ai.ToolRef
Knowledge []string
}
type Conversation ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) BuildPromptValues ¶
func (s *Engine) BuildPromptValues(ctx context.Context, agent entity.Agent, history []Conversation, thread Thread) (*ChatPromptValues, error)
func (*Engine) Generate ¶
func (e *Engine) Generate( ctx context.Context, req *GenerateRequest, out any, opts ...ai.GenerateOption, ) (*ai.ModelResponse, error)
type EvaluatorResponse ¶
type EvaluatorResponse struct {
Score float32 `json:"score" jsonschema_description:"Score of the response. 0.0 is the worst, 1.0 is the best"`
Reason string `json:"reason" jsonschema_description:"Reason of the score. It should be a short sentence."`
Suggestion []string `json:"suggestion" jsonschema_description:"Suggestion to improve the response. It should be a short sentence."`
}
type GenerateRequest ¶
type Participant ¶
type RunRequest ¶
type RunRequest struct {
ThreadInstruction string `json:"thread_instruction,omitempty"`
History []Conversation `json:"history"`
Participant []Participant `json:"participants,omitempty"`
}
type RunResponse ¶
type RunResponse struct {
ToolCalls []ToolCall `json:"tool_calls"`
}
type Thread ¶
type Thread struct {
Instruction string
Participants []Participant `json:"participants,omitempty"`
}
type ToolCall ¶
type ToolCall struct {
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments"`
Result json.RawMessage `json:"result"`
}
Click to show internal directories.
Click to hide internal directories.