Documentation
¶
Index ¶
- func InitAgent[G AgentApi](ctx context.Context, id string, states am.S, machSchema am.Schema, agent G) (G, error)
- func ToolAddToPrompts(t ToolApi, prompts ...PromptApi)
- type Agent
- func (a *Agent) DB() *sql.DB
- func (a *Agent) DBReadyEnd(e *am.Event)
- func (a *Agent) DBSavingEnter(e *am.Event) bool
- func (a *Agent) DBSavingState(e *am.Event)
- func (a *Agent) DBStartingState(e *am.Event)
- func (a *Agent) Log(txt string, args ...any)
- func (a *Agent) Mach() *am.Machine
- func (a *Agent) OpenAI() *instructor.InstructorOpenAI
- func (a *Agent) Output(txt string, from shared.From)
- func (a *Agent) PromptEnd(e *am.Event)
- func (a *Agent) PromptState(e *am.Event)
- func (a *Agent) Queries() *db.Queries
- func (a *Agent) RequestingExit(e *am.Event) bool
- func (a *Agent) RequestingLLMEnd(e *am.Event)
- func (a *Agent) RequestingLLMEnter(e *am.Event) bool
- func (a *Agent) RequestingLLMExit(e *am.Event) bool
- func (a *Agent) RequestingToolEnd(e *am.Event)
- func (a *Agent) RequestingToolEnter(e *am.Event) bool
- func (a *Agent) RequestingToolExit(e *am.Event) bool
- func (a *Agent) SetMach(m *am.Machine)
- func (a *Agent) SetOpenAI(c *instructor.InstructorOpenAI)
- func (a *Agent) Start() am.Result
- func (a *Agent) StartEnter(e *am.Event) bool
- func (a *Agent) StartState(e *am.Event)
- func (a *Agent) Stop(disposeCtx context.Context) am.Result
- type AgentApi
- type CheckpointSamples
- type Document
- type InRes
- type Prompt
- func (p *Prompt[P, R]) AddTool(tool ToolApi)
- func (p *Prompt[P, R]) AppendHistOpenAI(msg *openai.ChatCompletionMessage)
- func (p *Prompt[P, R]) Generate() string
- func (p *Prompt[P, R]) HistOpenAI() []openai.ChatCompletionMessage
- func (p *Prompt[P, R]) MsgsOpenAI() []openai.ChatCompletionMessage
- func (p *Prompt[P, R]) Run(params P, model string) (*R, error)
- type PromptApi
- type PromptSchemaless
- type S
- type Scenario
- type ScenarioSamples
- type Tool
- type ToolApi
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToolAddToPrompts ¶
Types ¶
type Agent ¶
type Agent struct {
*am.ExceptionHandler
*ssam.DisposedHandlers
// UserInput is a prompt submitted the user, owned by [schema.AgentStatesDef.Prompt].
UserInput string
// contains filtered or unexported fields
}
func (*Agent) DBReadyEnd ¶
func (*Agent) DBSavingState ¶
func (*Agent) DBStartingState ¶
func (*Agent) OpenAI ¶
func (a *Agent) OpenAI() *instructor.InstructorOpenAI
func (*Agent) PromptState ¶
func (*Agent) RequestingLLMEnd ¶
func (*Agent) RequestingToolEnd ¶
func (*Agent) SetOpenAI ¶
func (a *Agent) SetOpenAI(c *instructor.InstructorOpenAI)
func (*Agent) StartState ¶
type AgentApi ¶
type AgentApi interface {
Output(txt string, from shared.From)
Mach() *am.Machine
SetMach(*am.Machine)
SetOpenAI(c *instructor.InstructorOpenAI)
OpenAI() *instructor.InstructorOpenAI
Start() am.Result
Stop(disposeCtx context.Context) am.Result
Log(txt string, args ...any)
DB() *sql.DB
Queries() *db.Queries
}
type CheckpointSamples ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func NewDocument ¶
type Prompt ¶
type Prompt[P any, R any] struct { Conditions string Steps string Result string SchemaParams P SchemaResult R // number of previous messages to include HistoryMsgLen int // number of previous machine times to include HistoryStateLen int State string A AgentApi // contains filtered or unexported fields }
func (*Prompt[P, R]) AppendHistOpenAI ¶
func (p *Prompt[P, R]) AppendHistOpenAI(msg *openai.ChatCompletionMessage)
func (*Prompt[P, R]) HistOpenAI ¶
func (p *Prompt[P, R]) HistOpenAI() []openai.ChatCompletionMessage
func (*Prompt[P, R]) MsgsOpenAI ¶
func (p *Prompt[P, R]) MsgsOpenAI() []openai.ChatCompletionMessage
type PromptApi ¶
type PromptApi interface {
AddTool(tool ToolApi)
HistOpenAI() []openai.ChatCompletionMessage
AppendHistOpenAI(msg *openai.ChatCompletionMessage)
}
type PromptSchemaless ¶
type Scenario ¶
type Scenario struct {
// Name of the scenario
Name string
// scenario only applicable if these states are active (optional)
RequireActive am.S
// scenario only applicable if these states are inactive (optional)
RequireInactive am.S
// states possible to trigger (separately)
Inputs am.S
// states expected to happen
Checkpoints am.S
// additional context states (optional)
Contexts am.S
// number of future transitions to check for checkpoint activations, eg [1, 5, 10]
// will mark a checkpoint true if it gets activated in 1 or 5 or 10 txes
// from the input state
// default: [1]
ActivationDistances []int
// number of mutations to simulate and check for checkpoint confirmations
ScenarioSteps int // default: 1
}
Scenario produces ScenarioSamples for checkpoint states.
type ScenarioSamples ¶
type ScenarioSamples struct {
// active checkpoints in the beginning of the scenario
StartingCheckpoints []string
// names of input states, with only one being called at a time
Inputs []string
// names of checkpoint states
Checkpoint []string
// names of context states
Contexts []string
// samples with Checkpoint states as inputs
Samples []*CheckpointSamples
}
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
deepresearch
Package deepresearch is a port of atomic-agents/deepresearch to secai.
|
Package deepresearch is a port of atomic-agents/deepresearch to secai. |
|
deepresearch/cmd
command
|
|
|
Package schema contains a stateful schema-v2 for Agent.
|
Package schema contains a stateful schema-v2 for Agent. |
|
tools
|
|
Click to show internal directories.
Click to hide internal directories.
