Documentation
¶
Index ¶
- Constants
- func ApplyFileChanges(projectRoot string, changes []FileChange) error
- func GetAbsolutePath(path string) (string, error)
- func IsSymlinkToDir(path string) bool
- func NormalizeMessages(msgs []*chat.ChatCompletionMessage, defaultUserMessage string) (ret []*chat.ChatCompletionMessage)
- func ReturnItem(item string) string
- type Attachment
- type ChatOptions
- type ChatRequest
- type FileChange
- type GroupItems
- type GroupsItemsSelector
- func (o *GroupsItemsSelector[I]) AddGroupItems(group string, items ...I)
- func (o *GroupsItemsSelector[I]) FindGroupsByItem(item I) (groups []string)
- func (o *GroupsItemsSelector[I]) FindGroupsByItemFirst(item I) (ret string)
- func (o *GroupsItemsSelector[I]) GetGroupAndItemByItemNumber(number int) (group string, item I, err error)
- func (o *GroupsItemsSelector[I]) HasGroup(group string) (ret bool)
- func (o *GroupsItemsSelector[I]) Print(shellCompleteList bool)
- type GroupsItemsSelectorString
Constants ¶
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 ¶ added in v1.4.165
func ApplyFileChanges(projectRoot string, changes []FileChange) error
ApplyFileChanges applies the parsed file changes to the file system
func GetAbsolutePath ¶ added in v1.4.119
GetAbsolutePath resolves a given path to its absolute form, handling ~, ./, ../, UNC paths, and symlinks.
func IsSymlinkToDir ¶ added in v1.4.119
Helper function to check if a symlink points to a directory
func NormalizeMessages ¶
func NormalizeMessages(msgs []*chat.ChatCompletionMessage, defaultUserMessage string) (ret []*chat.ChatCompletionMessage)
NormalizeMessages remove empty messages and ensure messages order user-assist-user
func ReturnItem ¶ added in v1.4.67
Types ¶
type Attachment ¶ added in v1.4.79
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 ¶ added in v1.4.79
func NewAttachment(value string) (ret *Attachment, err error)
func (*Attachment) Base64Content ¶ added in v1.4.79
func (a *Attachment) Base64Content() (ret string, err error)
func (*Attachment) ContentBytes ¶ added in v1.4.79
func (a *Attachment) ContentBytes() (ret []byte, err error)
func (*Attachment) GetId ¶ added in v1.4.79
func (a *Attachment) GetId() (ret string, err error)
func (*Attachment) ResolveType ¶ added in v1.4.79
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
}
type ChatRequest ¶
type FileChange ¶ added in v1.4.165
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 ¶ added in v1.4.165
func ParseFileChanges(output string) (changeSummary string, changes []FileChange, err error)
ParseFileChanges extracts and parses the file change marker section from LLM output
type GroupItems ¶ added in v1.4.67
func (*GroupItems[I]) ContainsItemBy ¶ added in v1.4.67
func (o *GroupItems[I]) ContainsItemBy(predicate func(item I) bool) (ret bool)
func (*GroupItems[I]) Count ¶ added in v1.4.67
func (o *GroupItems[I]) Count() int
type GroupsItemsSelector ¶ added in v1.4.67
type GroupsItemsSelector[I any] struct { SelectionLabel string GetItemKey func(I) string GroupsItems []*GroupItems[I] }
func NewGroupsItemsSelector ¶ added in v1.4.67
func NewGroupsItemsSelector[I any](selectionLabel string, getItemLabel func(I) string) *GroupsItemsSelector[I]
func (*GroupsItemsSelector[I]) AddGroupItems ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) AddGroupItems(group string, items ...I)
func (*GroupsItemsSelector[I]) FindGroupsByItem ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) FindGroupsByItem(item I) (groups []string)
func (*GroupsItemsSelector[I]) FindGroupsByItemFirst ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) FindGroupsByItemFirst(item I) (ret string)
func (*GroupsItemsSelector[I]) GetGroupAndItemByItemNumber ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) GetGroupAndItemByItemNumber(number int) (group string, item I, err error)
func (*GroupsItemsSelector[I]) HasGroup ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) HasGroup(group string) (ret bool)
func (*GroupsItemsSelector[I]) Print ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) Print(shellCompleteList bool)
type GroupsItemsSelectorString ¶ added in v1.4.67
type GroupsItemsSelectorString struct {
*GroupsItemsSelector[string]
}
func NewGroupsItemsSelectorString ¶ added in v1.4.67
func NewGroupsItemsSelectorString(selectionLabel string) *GroupsItemsSelectorString
Click to show internal directories.
Click to hide internal directories.