Documentation
¶
Index ¶
- Variables
- func NewAnsweringPrompt(agent secai.AgentAPI) *secai.Prompt[ParamsAnswering, ResultAnswering]
- func NewCheckingInfoPrompt(agent secai.AgentAPI) *secai.Prompt[ParamsCheckingInfo, ResultCheckingInfo]
- func NewResearch(ctx context.Context) *am.Machine
- func NewSearchingLLMPrompt(agent secai.AgentAPI) *secai.Prompt[ParamsSearching, ResultSearching]
- type FollowUpQuestions
- type ParamsAnswering
- type ParamsCheckingInfo
- type ParamsSearching
- type ResearchGroupsDef
- type ResearchStatesDef
- type ResultAnswering
- type ResultCheckingInfo
- type ResultSearching
- type S
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ResearchStates contains all the states for the Research machine. ResearchStates = ssR // ResearchGroups contains all the state groups for the Research machine. ResearchGroups = sgR )
View Source
var Exception = am.Exception
Exception is a type alias for the exception state.
View Source
var ResearchSchema = SchemaMerge( llm.LLMAgentSchema, am.Schema{ ssR.CheckingInfo: { Require: S{ssR.Start, ssR.Prompt}, Remove: sgR.Info, }, ssR.NeedMoreInfo: { Require: S{ssR.Start}, Add: S{ssR.SearchingLLM}, Remove: sgR.Info, }, ssR.SearchingLLM: { Require: S{ssR.NeedMoreInfo, ssR.Prompt}, Remove: sgR.Search, }, ssR.SearchingWeb: { Require: S{ssR.NeedMoreInfo, ssR.Prompt}, Remove: sgR.Search, }, ssR.Scraping: { Require: S{ssR.NeedMoreInfo, ssR.Prompt}, Remove: sgR.Search, }, ssR.Answering: { Require: S{ssR.Start, ssR.Prompt}, Remove: SAdd(sgR.Info, sgR.Answers), }, ssR.Answered: { Require: S{ssR.Start}, Remove: SAdd(sgR.Info, sgR.Answers, S{ssR.Prompt}), }, ssR.Interrupted: StateAdd(ss.AgentSchema[ss.AgentStates.Interrupted], State{ Remove: S{ssR.CheckingInfo, ssR.SearchingLLM, ssR.SearchingWeb, ssR.Scraping}, }), ssR.Prompt: StateAdd(ss.AgentSchema[ss.AgentStates.Prompt], State{ Remove: S{ssR.Answered}, }), })
ResearchSchema represents all relations and properties of ResearchStates.
View Source
var SAdd = am.SAdd
SAdd is a func alias for merging lists of states.
View Source
var SchemaMerge = am.SchemaMerge
SchemaMerge is a func alias for extending an existing state schema.
View Source
var Sp = shared.Sp
View Source
var StateAdd = am.StateAdd
StateAdd is a func alias for adding to an existing state definition.
View Source
var StateSet = am.StateSet
StateSet is a func alias for replacing parts of an existing state definition.
Functions ¶
func NewAnsweringPrompt ¶
func NewAnsweringPrompt(agent secai.AgentAPI) *secai.Prompt[ParamsAnswering, ResultAnswering]
func NewCheckingInfoPrompt ¶
func NewCheckingInfoPrompt(agent secai.AgentAPI) *secai.Prompt[ParamsCheckingInfo, ResultCheckingInfo]
func NewResearch ¶
NewResearch will create the most basic Research state machine. TODO add to am-gen
func NewSearchingLLMPrompt ¶
func NewSearchingLLMPrompt(agent secai.AgentAPI) *secai.Prompt[ParamsSearching, ResultSearching]
Types ¶
type FollowUpQuestions ¶
type FollowUpQuestions []string
func (FollowUpQuestions) JSONSchema ¶
func (FollowUpQuestions) JSONSchema() *jsonschema.Schema
type ParamsAnswering ¶
type ParamsAnswering struct {
// The question to answer.
Question string
}
type ParamsCheckingInfo ¶
type ParamsSearching ¶
type ResearchGroupsDef ¶
ResearchGroupsDef contains all the state groups Research state machine.
type ResearchStatesDef ¶
type ResearchStatesDef struct {
*am.StatesBase
CheckingInfo string
NeedMoreInfo string
SearchingLLM string
SearchingWeb string
Scraping string
Answering string
Answered string
// inherit from LLM Agent
*llm.LLMAgentStatesDef
}
ResearchStatesDef contains all the states of the Research state machine.
type ResultAnswering ¶
type ResultAnswering struct {
// The answer to the question.
Answer string
FollowUpQuestions FollowUpQuestions
}
type ResultCheckingInfo ¶
type ResultSearching ¶
Click to show internal directories.
Click to hide internal directories.