generic

package
v0.0.0-...-be548ea Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PlanStatusMapping = map[PlanStatus]string{
	PlanStatusTodo:    "待执行",
	PlanStatusDoing:   "执行中",
	PlanStatusDone:    "已完成",
	PlanStatusFailed:  "执行失败",
	PlanStatusSkipped: "已跳过",
}
View Source
var PlanToolInfo = &schema.ToolInfo{
	Name: "create_plan",
	Desc: "Generates a structured, step-by-step execution plan to solve a given complex task. Each step in the plan must be assigned to a specialized agent and must have a clear, actionable description.",
	ParamsOneOf: schema.NewParamsOneOfByParams(
		map[string]*schema.ParameterInfo{
			"steps": {
				Type: schema.Array,
				ElemInfo: &schema.ParameterInfo{
					Type: schema.Object,
					SubParams: map[string]*schema.ParameterInfo{
						"index": {
							Type:     schema.Integer,
							Desc:     "The sequential number of this step in the overall plan. **Must start from 1 and increment by exactly 1 for each subsequent step.**",
							Required: true,
						},
						"desc": {
							Type:     schema.String,
							Desc:     "A clear, concise, and actionable description of the specific task to be performed in this step. It should be a direct instruction for the assigned agent.",
							Required: true,
						},
					},
				},
				Desc:     "different steps to follow, should be in sorted order",
				Required: true,
			},
		},
	),
}

Functions

func FullPlan2String

func FullPlan2String(plan []*FullPlan) string

func Write2PlanMD

func Write2PlanMD(ctx context.Context, op commandline.Operator, wd string, plan []*FullPlan) error

Types

type ExcelCell

type ExcelCell struct {
	Address string `json:"address,omitempty" xml:"address"` // B1:D1 表示 B1 到 D1 范围的单元格, B1 表示单个单元格
	Value   string `json:"value,omitempty" xml:"value"`     // 单元格的值
}

type FullPlan

type FullPlan struct {
	TaskID     int           `json:"task_id,omitempty"`
	Status     PlanStatus    `json:"status,omitempty"`
	AgentName  string        `json:"agent_name,omitempty"`
	Desc       string        `json:"desc,omitempty"`
	ExecResult *SubmitResult `json:"exec_result,omitempty"`
}

func (*FullPlan) PlanString

func (p *FullPlan) PlanString(n int) string

func (*FullPlan) String

func (p *FullPlan) String() string

type Plan

type Plan struct {
	Steps []Step `json:"steps"`
}

func (*Plan) FirstStep

func (p *Plan) FirstStep() string

func (*Plan) MarshalJSON

func (p *Plan) MarshalJSON() ([]byte, error)

func (*Plan) UnmarshalJSON

func (p *Plan) UnmarshalJSON(bytes []byte) error

type PlanStatus

type PlanStatus string
const (
	PlanStatusTodo    PlanStatus = "todo"
	PlanStatusDoing   PlanStatus = "doing"
	PlanStatusDone    PlanStatus = "done"
	PlanStatusFailed  PlanStatus = "failed"
	PlanStatusSkipped PlanStatus = "skipped"
)

type PreviewFile

type PreviewFile struct {
	FilePath           string               `json:"file_path,omitempty" xml:"file_path"`
	SingleFilePreviews []*SingleFilePreview `json:"single_file_previews,omitempty" xml:"single_file_previews>single_file_preview"`
}

func PreviewPath

func PreviewPath(path string) ([]*PreviewFile, error)

type SingleFilePreview

type SingleFilePreview struct {
	SheetName   string         `json:"sheet_name,omitempty" xml:"sheet_name"`
	Header      []*ExcelCell   `json:"header" xml:"header"`
	Content     [][]*ExcelCell `json:"content,omitempty" xml:"content"`
	MergedCells []*ExcelCell   `json:"merged_cells,omitempty" xml:"merged_cells>merged_cell"`
}

type Step

type Step struct {
	Index int    `json:"index"`
	Desc  string `json:"desc"`
}

type SubmitResult

type SubmitResult struct {
	IsSuccess *bool               `json:"is_success,omitempty"`
	Result    string              `json:"result,omitempty"`
	Files     []*SubmitResultFile `json:"files,omitempty"`
}

func (*SubmitResult) String

func (s *SubmitResult) String() string

type SubmitResultFile

type SubmitResultFile struct {
	Path string `json:"path,omitempty"`
	Desc string `json:"desc,omitempty"`
}

func ListDir

func ListDir(dir string) ([]*SubmitResultFile, error)

Jump to

Keyboard shortcuts

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