Documentation
¶
Index ¶
- Constants
- func ApplyFileChanges(projectRoot string, changes []FileChange) error
- func NormalizeMessages(msgs []*chat.ChatCompletionMessage, defaultUserMessage string) (ret []*chat.ChatCompletionMessage)
- func StripThinkBlocks(input, startTag, endTag string) string
- type Attachment
- type ChatOptions
- type ChatRequest
- type FileChange
Constants ¶
View Source
const ( DefaultTemperature = 0.7 DefaultTopP = 0.9 DefaultPresencePenalty = 0.0 DefaultFrequencyPenalty = 0.0 )
Default values for chat options (must match cli/flags.go defaults)
View Source
const ChatMessageRoleMeta = "meta"
View Source
const FileChangesMarker = "__CREATE_CODING_FEATURE_FILE_CHANGES__"
FileChangesMarker identifies the start of a file changes section in output
View Source
const (
// MaxFileSize is the maximum size of a file that can be created (10MB)
MaxFileSize = 10 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func ApplyFileChanges ¶
func ApplyFileChanges(projectRoot string, changes []FileChange) error
ApplyFileChanges applies the parsed file changes to the file system
func NormalizeMessages ¶
func NormalizeMessages(msgs []*chat.ChatCompletionMessage, defaultUserMessage string) (ret []*chat.ChatCompletionMessage)
NormalizeMessages remove empty messages and ensure messages order user-assist-user
func StripThinkBlocks ¶ added in v1.4.252
Types ¶
type Attachment ¶
type Attachment struct {
Type *string `json:"type,omitempty"`
Path *string `json:"path,omitempty"`
URL *string `json:"url,omitempty"`
Content []byte `json:"content,omitempty"`
ID *string `json:"id,omitempty"`
}
func NewAttachment ¶
func NewAttachment(value string) (ret *Attachment, err error)
func (*Attachment) Base64Content ¶
func (a *Attachment) Base64Content() (ret string, err error)
func (*Attachment) ContentBytes ¶
func (a *Attachment) ContentBytes() (ret []byte, err error)
func (*Attachment) GetId ¶
func (a *Attachment) GetId() (ret string, err error)
func (*Attachment) ResolveType ¶
func (a *Attachment) ResolveType() (ret string, err error)
type ChatOptions ¶
type ChatOptions struct {
Model string
Temperature float64
TopP float64
PresencePenalty float64
FrequencyPenalty float64
Raw bool
Seed int
ModelContextLength int
MaxTokens int
Search bool
SearchLocation string
ImageFile string
ImageSize string
ImageQuality string
ImageCompression int
ImageBackground string
SuppressThink bool
ThinkStartTag string
ThinkEndTag string
AudioOutput bool
AudioFormat string
Voice string
}
type ChatRequest ¶
type FileChange ¶
type FileChange struct {
Operation string `json:"operation"` // "create" or "update"
Path string `json:"path"` // Relative path from project root
Content string `json:"content"` // New file content
}
FileChange represents a single file change operation to be performed
func ParseFileChanges ¶
func ParseFileChanges(output string) (changeSummary string, changes []FileChange, err error)
ParseFileChanges extracts and parses the file change marker section from LLM output
Click to show internal directories.
Click to hide internal directories.