Documentation
¶
Index ¶
- type BasedOnStyle
- type BorderInfo
- type ContentItem
- type ContentType
- type CustomStyleDef
- type FieldDef
- type FontDef
- type GeminiOption
- type KeyDef
- type Maker
- func (m *Maker) AddPredictableKeys(keys ...KeyDef) *Maker
- func (m *Maker) Generate() (string, error)
- func (m *Maker) LastProvider() string
- func (m *Maker) LastResult() string
- func (m *Maker) MaxRetries(n int) *Maker
- func (m *Maker) OptionalPrompt(p string) *Maker
- func (m *Maker) PredictableKeys(keys ...KeyDef) *Maker
- func (m *Maker) Run(output string) error
- func (m *Maker) Source(path string) *Maker
- func (m *Maker) UnpredictableKeys() []string
- func (m *Maker) UnpredictableObjects() []UnpredictableObject
- type Message
- type NoteItem
- type OpenAIOption
- func WithOpenAIAPIKey(k string) OpenAIOption
- func WithOpenAIBaseURL(u string) OpenAIOption
- func WithOpenAIMaxTokens(n int) OpenAIOption
- func WithOpenAIModel(m string) OpenAIOption
- func WithOpenAIStream(s bool) OpenAIOption
- func WithOpenAITemperature(t float64) OpenAIOption
- func WithOpenAITimeout(d time.Duration) OpenAIOption
- type PageLayout
- type ParsedDocument
- type ParsedHdrFtr
- type ParsedParagraph
- type ParsedSection
- type ParsedTable
- type ParsedTableCell
- type ParsedTableRow
- type Provider
- type StyleDef
- type TabStopDef
- type TextRun
- type ThemeData
- type UnpredictableObject
- type VarType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasedOnStyle ¶
type ContentItem ¶
type ContentItem struct {
Type ContentType
Paragraph *ParsedParagraph
Table *ParsedTable
}
type CustomStyleDef ¶
type FieldDef ¶
type GeminiOption ¶
type GeminiOption func(*geminiConfig)
func WithAPIKey ¶
func WithAPIKey(k string) GeminiOption
func WithModel ¶
func WithModel(m string) GeminiOption
func WithStream ¶
func WithStream(s bool) GeminiOption
func WithTemperature ¶
func WithTemperature(t float64) GeminiOption
func WithTimeout ¶
func WithTimeout(d time.Duration) GeminiOption
type KeyDef ¶
type Maker ¶
type Maker struct {
// contains filtered or unexported fields
}
func (*Maker) AddPredictableKeys ¶
func (*Maker) LastProvider ¶ added in v0.2.3
func (*Maker) LastResult ¶
func (*Maker) MaxRetries ¶
func (*Maker) OptionalPrompt ¶
func (*Maker) PredictableKeys ¶
func (*Maker) UnpredictableKeys ¶
func (*Maker) UnpredictableObjects ¶
func (m *Maker) UnpredictableObjects() []UnpredictableObject
type OpenAIOption ¶
type OpenAIOption func(*openAIConfig)
func WithOpenAIAPIKey ¶
func WithOpenAIAPIKey(k string) OpenAIOption
func WithOpenAIBaseURL ¶
func WithOpenAIBaseURL(u string) OpenAIOption
func WithOpenAIMaxTokens ¶ added in v0.2.3
func WithOpenAIMaxTokens(n int) OpenAIOption
func WithOpenAIModel ¶
func WithOpenAIModel(m string) OpenAIOption
func WithOpenAIStream ¶
func WithOpenAIStream(s bool) OpenAIOption
func WithOpenAITemperature ¶ added in v0.2.3
func WithOpenAITemperature(t float64) OpenAIOption
func WithOpenAITimeout ¶ added in v0.2.3
func WithOpenAITimeout(d time.Duration) OpenAIOption
type PageLayout ¶
type ParsedDocument ¶
type ParsedDocument struct {
PageLayout PageLayout
DefaultFont FontDef
LineHeight float64
LineRule string
Title string
Subject string
Author string
Keywords string
Description string
Category string
ContentStatus string
LastModifiedBy string
Revision string
Version string
Created string
Modified string
Language string
Application string
AppVersion string
HeadingStyles map[int]StyleDef
Content []ContentItem
Sections []ParsedSection
AllTables []ParsedTable
Notes []NoteItem
CustomStyles []CustomStyleDef
Mode string // "semantic" (default) or "lossless"
Theme *ThemeData
}
func ParseDOCX ¶
func ParseDOCX(data []byte) (*ParsedDocument, error)
func (*ParsedDocument) FormatForLLM ¶
func (doc *ParsedDocument) FormatForLLM() string
func (*ParsedDocument) GenerateStyleBlock ¶
func (doc *ParsedDocument) GenerateStyleBlock() string
type ParsedHdrFtr ¶
type ParsedHdrFtr struct {
Type string // "default", "first", "even"
Content []ContentItem
}
type ParsedParagraph ¶
type ParsedParagraph struct {
Runs []TextRun
Align string
IndentLeft float64
IndentRight float64
FirstLineIndent float64
Hanging float64
SpacingBefore float64
SpacingAfter float64
LineHeight float64
LineRule string
Bold bool
Italic bool
FontFamily string
FontSizePt float64
FontColor string
HeadingLevel int
IsList bool
ListLevel int
ListFormat string
ListStartOverride int
StyleID string
StyleName string
KeepNext bool
KeepLines bool
WidowControl bool
ContextualSpacing bool
SuppressLineNumbers bool
SuppressHyphenation bool
TextDirection string
BorderTop *BorderInfo
BorderBottom *BorderInfo
BorderLeft *BorderInfo
BorderRight *BorderInfo
ShadingFill string
PageBreakBefore bool
Kinsoku bool
WordWrap bool
CharSpacingJust int
TwoLineOne bool
AutoSpaceDE bool
AutoSpaceDN bool
Bidi bool
IsCode bool
IsQuote bool
Lang string
VAlign string
TabStops []TabStopDef
}
type ParsedSection ¶
type ParsedSection struct {
Layout PageLayout
Headers []ParsedHdrFtr
Content []ContentItem
BreakType string
ColCount int
ColSpace float64
PageNumFmt string
PageNumStart int
}
type ParsedTable ¶
type ParsedTable struct {
ID int
Grid []float64
Rows []ParsedTableRow
HasBorders bool
BorderTop *BorderInfo
BorderBottom *BorderInfo
BorderLeft *BorderInfo
BorderRight *BorderInfo
Width float64
Alignment string
Caption string
Summary string
Indent float64
CellSpacing float64
StyleName string
}
type ParsedTableCell ¶
type ParsedTableCell struct {
Content []ContentItem
GridSpan int
RowSpan int
VMerge string
ShadingFill string
BorderTop *BorderInfo
BorderBottom *BorderInfo
BorderLeft *BorderInfo
BorderRight *BorderInfo
VAlign string
TextDirection string
NoWrap bool
}
type ParsedTableRow ¶
type ParsedTableRow struct {
IsHeader bool
Cells []ParsedTableCell
}
type Provider ¶
type Provider interface {
Name() string
GenerateWithFile(ctx context.Context, prompt string, filename string, data []byte) (string, error)
GenerateWithHistory(ctx context.Context, history []Message, prompt string) (string, error)
}
func Gemini ¶
func Gemini(opts ...GeminiOption) Provider
func OpenAI ¶
func OpenAI(opts ...OpenAIOption) Provider
type StyleDef ¶
type StyleDef struct {
Family string
FontEA string
FontCS string
SizePt float64
SizeCS float64
Color string
Bold bool
Italic bool
Underline string
Strikethrough bool
SmallCaps bool
Uppercase bool
SpacingBefore float64
SpacingAfter float64
LineSpacing float64
LineRule string
Align string
IndentLeft float64
IndentRight float64
IndentFirst float64
IndentHanging float64
BorderTop string
BorderBottom string
BorderLeft string
BorderRight string
BorderWidth int
BorderColor string
BorderStyle string
HeadingLevel int
}
type TabStopDef ¶
type TextRun ¶
type TextRun struct {
Text string
Bold bool
Italic bool
Underline string
Strike bool
DStrike bool
SuperScript bool
SubScript bool
FontFamily string
FontSizePt float64
FontColor string
Highlight string
SmallCaps bool
AllCaps bool
Hidden bool
CharSpacing int
Position int
Language string
Emphasis string
RTL bool
NoProof bool
CS bool
SpecVanish bool
Emboss bool
Engrave bool
Shadow bool
Imprint bool
Border string
Effect bool
Animate bool
BCs bool
ICs bool
FontEA string
FontCS string
SizeCS float64
BreakType string
IsTab bool
IsLineBreak bool
IsPageBreak bool
IsImage bool
IsSym bool
SymChar rune
IsNoBreakHyphen bool
IsSoftHyphen bool
IsCarriageReturn bool
ImageSrc string
ImageWidth float64
ImageHeight float64
ImageAlt string
IsField bool
FieldType string
FieldFormat string
FieldName string
IsHyperlink bool
HyperlinkURL string
IsFootnoteRef bool
IsEndnoteRef bool
NoteID int
TextBoxContent []ContentItem
IsIns bool
IsDel bool
InsID int
InsAuthor string
InsDate string
SpacePreserve bool
}
type UnpredictableObject ¶
Click to show internal directories.
Click to hide internal directories.