schema

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 NewResearch

func NewResearch(ctx context.Context) *am.Machine

NewResearch will create the most basic Research state machine. TODO add to am-gen

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 ParamsCheckingInfo struct {
	UserMessage  string
	DecisionType string
}

type ParamsSearching

type ParamsSearching struct {
	// A detailed instruction or request to generate search engine queries for.
	Instruction string
	// The number of search queries to generate.
	NumQueries int
}

type ResearchGroupsDef

type ResearchGroupsDef struct {
	Info    S
	Search  S
	Answers S
}

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 ResultCheckingInfo struct {
	// Detailed explanation of the decision-making process
	Reasoning string
	// The final decision based on the analysis
	Decision bool
}

type ResultSearching

type ResultSearching = websearch.Params

type S

type S = am.S

S is a type alias for a list of state names.

type State

type State = am.State

State is a type alias for a state definition. See am.State.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL