Documentation
¶
Index ¶
- Variables
- type CoCreateSession
- func (s *CoCreateSession) AppendUser(text string)
- func (s *CoCreateSession) ApplyDelta(kind, text string)
- func (s *CoCreateSession) ApplyReply(reply host.CoCreateReply)
- func (s *CoCreateSession) BuildPlan() (Plan, error)
- func (s *CoCreateSession) CanStart() bool
- func (s *CoCreateSession) DraftPrompt() string
- func (s *CoCreateSession) History() []host.CoCreateMessage
- func (s *CoCreateSession) InitialInput() string
- func (s *CoCreateSession) Ready() bool
- func (s *CoCreateSession) StreamReply() string
- func (s *CoCreateSession) StreamThinking() string
- func (s *CoCreateSession) Suggestions() []string
- type Mode
- type Plan
- type Request
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = fmt.Errorf("startup mode not implemented")
ErrNotImplemented 标记占位策略尚未落地。
Functions ¶
This section is empty.
Types ¶
type CoCreateSession ¶
type CoCreateSession struct {
// contains filtered or unexported fields
}
CoCreateSession 承载共创模式的非 UI 状态。
func NewCoCreateSession ¶
func NewCoCreateSession(initial string) *CoCreateSession
func (*CoCreateSession) AppendUser ¶
func (s *CoCreateSession) AppendUser(text string)
func (*CoCreateSession) ApplyDelta ¶
func (s *CoCreateSession) ApplyDelta(kind, text string)
ApplyDelta 接收流式累积;kind="thinking" 写入推理流,"reply" 写入回复预览。 两路分别累积,UI 可分块染色显示,让用户在 thinking 阶段也看到 LLM 在工作。
func (*CoCreateSession) ApplyReply ¶
func (s *CoCreateSession) ApplyReply(reply host.CoCreateReply)
func (*CoCreateSession) BuildPlan ¶
func (s *CoCreateSession) BuildPlan() (Plan, error)
func (*CoCreateSession) CanStart ¶
func (s *CoCreateSession) CanStart() bool
func (*CoCreateSession) DraftPrompt ¶
func (s *CoCreateSession) DraftPrompt() string
func (*CoCreateSession) History ¶
func (s *CoCreateSession) History() []host.CoCreateMessage
func (*CoCreateSession) InitialInput ¶
func (s *CoCreateSession) InitialInput() string
func (*CoCreateSession) Ready ¶
func (s *CoCreateSession) Ready() bool
func (*CoCreateSession) StreamReply ¶
func (s *CoCreateSession) StreamReply() string
func (*CoCreateSession) StreamThinking ¶ added in v0.3.1
func (s *CoCreateSession) StreamThinking() string
func (*CoCreateSession) Suggestions ¶ added in v0.3.1
func (s *CoCreateSession) Suggestions() []string
type Plan ¶
type Plan struct {
Mode Mode
DisplayName string
RawPrompt string // 用户原始创作要求(未包装);供用户规则归一化使用,resume 模式为空
ResumeOnly bool
}
Plan 描述启动策略层产出的结果。 宿主入口不应自己拼接正式启动 prompt,而应消费 Plan 再驱动 Engine。
func PrepareContinueFromNovel ¶
PrepareContinueFromNovel 是“根据已有小说续写”的统一预留落点。 TUI/headless 未来都应先把输入整理到 Request,再从这里产出可进入 Engine 的 Plan。
func PrepareQuick ¶
PrepareQuick 将直接输入整理为可进入 Engine 的快速启动计划。
Click to show internal directories.
Click to hide internal directories.