core

package
v1.4.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 33 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultPatternsGitRepoFolder = "patterns"
View Source
const DefaultPatternsGitRepoUrl = "https://github.com/danielmiessler/fabric.git"
View Source
const NoSessionPatternUserMessages = "no session, pattern or user messages provided"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelName

type ChannelName struct {
	// contains filtered or unexported fields
}

type Chat

type Chat struct {
	Context  string
	Pattern  string
	Message  string
	Session  *db.Session
	Language string
}

func (*Chat) BuildChatSession

func (o *Chat) BuildChatSession(raw bool) (ret *db.Session, err error)

type Chatter

type Chatter struct {
	Stream bool
	DryRun bool
	// contains filtered or unexported fields
}

func (*Chatter) NewChat

func (o *Chatter) NewChat(request *common.ChatRequest) (ret *Chat, err error)

func (*Chatter) Send

func (o *Chatter) Send(request *common.ChatRequest, opts *common.ChatOptions) (message string, err error)

type Fabric

type Fabric struct {
	*common.Configurable
	*VendorsManager
	VendorsAll *VendorsManager
	*PatternsLoader
	*youtube.YouTube
	Jina *jina.Client

	Db *db.Db

	DefaultVendor *common.Setting
	DefaultModel  *common.SetupQuestion
}

func NewFabric

func NewFabric(db *db.Db) (ret *Fabric, err error)

func NewFabricBase

func NewFabricBase(db *db.Db) (ret *Fabric)

NewFabricBase Create a new Fabric from a list of already configured VendorsController

func NewFabricForSetup

func NewFabricForSetup(db *db.Db) (ret *Fabric)

func (*Fabric) CopyToClipboard

func (o *Fabric) CopyToClipboard(message string) (err error)

func (*Fabric) CreateOutputFile

func (o *Fabric) CreateOutputFile(message string, fileName string) (err error)

func (*Fabric) GetChatter

func (o *Fabric) GetChatter(model string, stream bool, dryRun bool) (ret *Chatter, err error)

func (*Fabric) SaveEnvFile

func (o *Fabric) SaveEnvFile() (err error)

func (*Fabric) Setup

func (o *Fabric) Setup() (err error)

func (*Fabric) SetupDefaultModel

func (o *Fabric) SetupDefaultModel() (err error)

func (*Fabric) SetupVendors

func (o *Fabric) SetupVendors() (err error)

type PatternsLoader

type PatternsLoader struct {
	*common.Configurable
	Patterns *db.Patterns

	DefaultGitRepoUrl *common.SetupQuestion
	DefaultFolder     *common.SetupQuestion
	// contains filtered or unexported fields
}

func NewPatternsLoader

func NewPatternsLoader(patterns *db.Patterns) (ret *PatternsLoader)

func (*PatternsLoader) PersistPatterns

func (o *PatternsLoader) PersistPatterns() (err error)

PersistPatterns copies custom patterns to the updated patterns directory

func (*PatternsLoader) PopulateDB

func (o *PatternsLoader) PopulateDB() (err error)

PopulateDB downloads patterns from the internet and populates the patterns folder

type VendorsManager

type VendorsManager struct {
	Vendors map[string]vendors.Vendor
	Models  *VendorsModels
}

func NewVendorsManager

func NewVendorsManager() *VendorsManager

func (*VendorsManager) AddVendors

func (o *VendorsManager) AddVendors(vendors ...vendors.Vendor)

func (*VendorsManager) FindByName

func (o *VendorsManager) FindByName(name string) vendors.Vendor

func (*VendorsManager) GetModels

func (o *VendorsManager) GetModels() *VendorsModels

func (*VendorsManager) HasVendors

func (o *VendorsManager) HasVendors() bool

func (*VendorsManager) Setup

func (o *VendorsManager) Setup() (ret map[string]vendors.Vendor, err error)

type VendorsModels

type VendorsModels struct {
	Vendors       []string
	VendorsModels map[string][]string
	Errs          []error
}

func NewVendorsModels

func NewVendorsModels() *VendorsModels

func (*VendorsModels) AddError

func (o *VendorsModels) AddError(err error)

func (*VendorsModels) AddVendorModels

func (o *VendorsModels) AddVendorModels(vendor string, models []string)

func (*VendorsModels) FindVendorsByModel

func (o *VendorsModels) FindVendorsByModel(model string) (vendors []string)

func (*VendorsModels) FindVendorsByModelFirst

func (o *VendorsModels) FindVendorsByModelFirst(model string) (ret string)

func (*VendorsModels) GetVendorAndModelByModelIndex

func (o *VendorsModels) GetVendorAndModelByModelIndex(modelIndex int) (vendor string, model string)

func (*VendorsModels) GetVendorModels

func (o *VendorsModels) GetVendorModels(vendor string) (models []string)

func (*VendorsModels) HasVendor

func (o *VendorsModels) HasVendor(vendor string) (ret bool)

func (*VendorsModels) Print

func (o *VendorsModels) Print()

func (*VendorsModels) PrintVendor

func (o *VendorsModels) PrintVendor(vendor string, modelIndex int) (currentModelIndex int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL