Documentation
¶
Index ¶
- func LoadPromptFile(path string) (string, error)
- func PrepareQuick(rawPrompt string) (string, error)
- 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) BuildPrompt() (string, 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPromptFile ¶ added in v0.7.6
LoadPromptFile 读取文件作为初始创作要求。
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) BuildPrompt ¶ added in v0.7.6
func (s *CoCreateSession) BuildPrompt() (string, 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
Click to show internal directories.
Click to hide internal directories.