Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crew ¶
type Crew struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Members map[string]*CrewMember `json:"members"`
Tasks []*CrewTask `json:"tasks"`
Process ProcessType `json:"process"`
Verbose bool `json:"verbose"`
// contains filtered or unexported fields
}
船员代表一组特工一起工作.
type CrewAgent ¶
type CrewAgent interface {
ID() string
Execute(ctx context.Context, task CrewTask) (*TaskResult, error)
Negotiate(ctx context.Context, proposal Proposal) (*NegotiationResult, error)
}
机组特工的机组接口
type CrewConfig ¶
type CrewConfig struct {
Name string
Description string
Process ProcessType
Verbose bool
}
CrewConfig配置一个船员.
type CrewMember ¶
type CrewMember struct {
ID string `json:"id"`
Role Role `json:"role"`
Agent CrewAgent `json:"-"`
Status MemberStatus `json:"status"`
Metadata map[string]any `json:"metadata,omitempty"`
}
船员代表一个船员的特工
type CrewResult ¶
type CrewResult struct {
CrewID string `json:"crew_id"`
TaskResults map[string]*TaskResult `json:"task_results"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
}
CrewResult载有船员行刑的结果.
type CrewTask ¶
type CrewTask struct {
ID string `json:"id"`
Description string `json:"description"`
Expected string `json:"expected_output"`
Context string `json:"context,omitempty"`
AssignedTo string `json:"assigned_to,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Priority int `json:"priority"`
Metadata map[string]any `json:"metadata,omitempty"`
}
船员任务代表着船员的任务.
type MemberStatus ¶
type MemberStatus string
成员地位代表船员地位。
const ( MemberStatusIdle MemberStatus = "idle" MemberStatusWorking MemberStatus = "working" MemberStatusWaiting MemberStatus = "waiting" )
type NegotiationResult ¶
type NegotiationResult struct {
Accepted bool `json:"accepted"`
Response string `json:"response"`
Counter *Proposal `json:"counter_proposal,omitempty"`
}
谈判成果是谈判的结果。
type ProcessType ¶
type ProcessType string
ProcessType定义任务处理方式.
const ( ProcessSequential ProcessType = "sequential" ProcessHierarchical ProcessType = "hierarchical" ProcessConsensus ProcessType = "consensus" )
type Proposal ¶
type Proposal struct {
Type ProposalType `json:"type"`
FromMember string `json:"from_member"`
ToMember string `json:"to_member,omitempty"`
Task *CrewTask `json:"task,omitempty"`
Message string `json:"message"`
Metadata map[string]any `json:"metadata,omitempty"`
}
提案是谈判提案。
type ProposalType ¶
type ProposalType string
提案Type定义了提案的类型.
const ( ProposalTypeDelegate ProposalType = "delegate" ProposalTypeAssist ProposalType = "assist" ProposalTypeInform ProposalType = "inform" ProposalTypeRequest ProposalType = "request" )
type Role ¶
type Role struct {
Name string `json:"name"`
Description string `json:"description"`
Goal string `json:"goal"`
Backstory string `json:"backstory,omitempty"`
Skills []string `json:"skills"`
Tools []string `json:"tools,omitempty"`
AllowDelegation bool `json:"allow_delegation"`
}
角色定义了代理人在船员中的角色.
Click to show internal directories.
Click to hide internal directories.