Documentation ¶
Index ¶
- Constants
- func GetSimpleRawMessageLogger(perpetualDir string) func(v ...any)
- func RenderMessagesToAIStrings(filesToMdLangMappings [][2]string, messages []Message) ([]string, error)
- type AnthropicLLMConnector
- func (p *AnthropicLLMConnector) GetDebugString() string
- func (p *AnthropicLLMConnector) GetMaxTokensSegments() int
- func (p *AnthropicLLMConnector) GetOnFailureRetryLimit() int
- func (p *AnthropicLLMConnector) GetOptionsString() string
- func (p *AnthropicLLMConnector) GetVariantCount() int
- func (p *AnthropicLLMConnector) GetVariantSelectionStrategy() VariantSelectionStrategy
- func (p *AnthropicLLMConnector) Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error)
- type Fragment
- type FragmentType
- type LLMConnector
- type Message
- func AddFileFragment(message Message, filename string, contents string, tags []string) Message
- func AddIndexFragment(message Message, filename string, tags []string) Message
- func AddMultilineTaggedFragment(message Message, multilineContent string, tags []string) Message
- func AddPlainTextFragment(message Message, text string) Message
- func AddTaggedFragment(message Message, contents string, tags []string) Message
- func NewMessage(messageType MessageType) Message
- func SetRawResponse(message Message, rawResponse string) Message
- type MessageType
- type OllamaLLMConnector
- func (p *OllamaLLMConnector) GetDebugString() string
- func (p *OllamaLLMConnector) GetMaxTokensSegments() int
- func (p *OllamaLLMConnector) GetOnFailureRetryLimit() int
- func (p *OllamaLLMConnector) GetOptionsString() string
- func (p *OllamaLLMConnector) GetVariantCount() int
- func (p *OllamaLLMConnector) GetVariantSelectionStrategy() VariantSelectionStrategy
- func (p *OllamaLLMConnector) Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error)
- type OpenAILLMConnector
- func (p *OpenAILLMConnector) GetDebugString() string
- func (p *OpenAILLMConnector) GetMaxTokensSegments() int
- func (p *OpenAILLMConnector) GetOnFailureRetryLimit() int
- func (p *OpenAILLMConnector) GetOptionsString() string
- func (p *OpenAILLMConnector) GetVariantCount() int
- func (p *OpenAILLMConnector) GetVariantSelectionStrategy() VariantSelectionStrategy
- func (p *OpenAILLMConnector) Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error)
- type QueryStatus
- type VariantSelectionStrategy
Constants ¶
View Source
const LLMRawLogFile = ".message_log.txt"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnthropicLLMConnector ¶
type AnthropicLLMConnector struct { Subprofile string BaseURL string Token string Model string SystemPrompt string FilesToMdLangMappings [][2]string MaxTokensSegments int OnFailRetries int Seed int RawMessageLogger func(v ...any) Options []llms.CallOption Variants int VariantStrategy VariantSelectionStrategy }
func NewAnthropicLLMConnector ¶
func NewAnthropicLLMConnector(subprofile string, token string, model string, systemPrompt string, filesToMdLangMappings [][2]string, customBaseURL string, maxTokensSegments int, onFailRetries int, seed int, llmRawMessageLogger func(v ...any), options []llms.CallOption, variants int, variantStrategy VariantSelectionStrategy) *AnthropicLLMConnector
func (*AnthropicLLMConnector) GetDebugString ¶ added in v1.9.0
func (p *AnthropicLLMConnector) GetDebugString() string
func (*AnthropicLLMConnector) GetMaxTokensSegments ¶ added in v1.4.1
func (p *AnthropicLLMConnector) GetMaxTokensSegments() int
func (*AnthropicLLMConnector) GetOnFailureRetryLimit ¶ added in v1.4.1
func (p *AnthropicLLMConnector) GetOnFailureRetryLimit() int
func (*AnthropicLLMConnector) GetOptionsString ¶ added in v1.4.1
func (p *AnthropicLLMConnector) GetOptionsString() string
func (*AnthropicLLMConnector) GetVariantCount ¶ added in v1.9.0
func (p *AnthropicLLMConnector) GetVariantCount() int
func (*AnthropicLLMConnector) GetVariantSelectionStrategy ¶ added in v1.9.0
func (p *AnthropicLLMConnector) GetVariantSelectionStrategy() VariantSelectionStrategy
func (*AnthropicLLMConnector) Query ¶
func (p *AnthropicLLMConnector) Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error)
type Fragment ¶
type Fragment struct { Type FragmentType Contents string FileName string FileNameTags string }
type FragmentType ¶
type FragmentType int
const ( PlainTextFragment FragmentType = iota IndexFragment FileFragment TaggedFragment MultilineTaggedFragment )
type LLMConnector ¶
type LLMConnector interface { // Main interaction point with LLM Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error) // When response bumps max token limit, try to continue generating next segment, until reaching this limit GetMaxTokensSegments() int GetOnFailureRetryLimit() int GetDebugString() string // Results variant-count management. GetVariantCount() int GetVariantSelectionStrategy() VariantSelectionStrategy }
func NewLLMConnector ¶
type Message ¶
type Message struct { Type MessageType Fragments []Fragment RawText string }
func AddFileFragment ¶
func AddIndexFragment ¶
func AddPlainTextFragment ¶
func AddTaggedFragment ¶
func NewMessage ¶
func NewMessage(messageType MessageType) Message
func SetRawResponse ¶
type MessageType ¶
type MessageType int
const ( UserRequest MessageType = iota SimulatedAIResponse RealAIResponse )
type OllamaLLMConnector ¶ added in v1.4.1
type OllamaLLMConnector struct { Subprofile string BaseURL string Model string SystemPrompt string FilesToMdLangMappings [][2]string MaxTokensSegments int OnFailRetries int Seed int RawMessageLogger func(v ...any) Options []llms.CallOption Variants int VariantStrategy VariantSelectionStrategy }
func NewOllamaLLMConnector ¶ added in v1.4.1
func NewOllamaLLMConnector(subprofile string, model string, systemPrompt string, filesToMdLangMappings [][2]string, customBaseURL string, maxTokensSegments int, onFailRetries int, seed int, llmRawMessageLogger func(v ...any), options []llms.CallOption, variants int, variantStrategy VariantSelectionStrategy) *OllamaLLMConnector
func NewOllamaLLMConnectorFromEnv ¶ added in v1.4.1
func (*OllamaLLMConnector) GetDebugString ¶ added in v1.9.0
func (p *OllamaLLMConnector) GetDebugString() string
func (*OllamaLLMConnector) GetMaxTokensSegments ¶ added in v1.4.1
func (p *OllamaLLMConnector) GetMaxTokensSegments() int
func (*OllamaLLMConnector) GetOnFailureRetryLimit ¶ added in v1.4.1
func (p *OllamaLLMConnector) GetOnFailureRetryLimit() int
func (*OllamaLLMConnector) GetOptionsString ¶ added in v1.4.1
func (p *OllamaLLMConnector) GetOptionsString() string
func (*OllamaLLMConnector) GetVariantCount ¶ added in v1.9.0
func (p *OllamaLLMConnector) GetVariantCount() int
func (*OllamaLLMConnector) GetVariantSelectionStrategy ¶ added in v1.9.0
func (p *OllamaLLMConnector) GetVariantSelectionStrategy() VariantSelectionStrategy
func (*OllamaLLMConnector) Query ¶ added in v1.4.1
func (p *OllamaLLMConnector) Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error)
type OpenAILLMConnector ¶
type OpenAILLMConnector struct { Subprofile string BaseURL string Token string Model string SystemPrompt string FilesToMdLangMappings [][2]string MaxTokensSegments int OnFailRetries int RawMessageLogger func(v ...any) Options []llms.CallOption Variants int VariantStrategy VariantSelectionStrategy }
func NewOpenAILLMConnector ¶
func NewOpenAILLMConnector(subprofile string, token string, model string, systemPrompt string, filesToMdLangMappings [][2]string, customBaseURL string, maxTokensSegments int, onFailRetries int, llmRawMessageLogger func(v ...any), options []llms.CallOption, variants int, variantStrategy VariantSelectionStrategy) *OpenAILLMConnector
func (*OpenAILLMConnector) GetDebugString ¶ added in v1.9.0
func (p *OpenAILLMConnector) GetDebugString() string
func (*OpenAILLMConnector) GetMaxTokensSegments ¶ added in v1.4.1
func (p *OpenAILLMConnector) GetMaxTokensSegments() int
func (*OpenAILLMConnector) GetOnFailureRetryLimit ¶ added in v1.4.1
func (p *OpenAILLMConnector) GetOnFailureRetryLimit() int
func (*OpenAILLMConnector) GetOptionsString ¶ added in v1.4.1
func (p *OpenAILLMConnector) GetOptionsString() string
func (*OpenAILLMConnector) GetVariantCount ¶ added in v1.9.0
func (p *OpenAILLMConnector) GetVariantCount() int
func (*OpenAILLMConnector) GetVariantSelectionStrategy ¶ added in v1.9.0
func (p *OpenAILLMConnector) GetVariantSelectionStrategy() VariantSelectionStrategy
func (*OpenAILLMConnector) Query ¶
func (p *OpenAILLMConnector) Query(maxCandidates int, messages ...Message) ([]string, QueryStatus, error)
type QueryStatus ¶
type QueryStatus int
const ( QueryOk QueryStatus = iota QueryInitFailed QueryMaxTokens QueryFailed )
type VariantSelectionStrategy ¶ added in v1.9.0
type VariantSelectionStrategy int
const ( Short VariantSelectionStrategy = iota Long Combine )
Click to show internal directories.
Click to hide internal directories.