gptcommentary

package
v0.0.0-...-d770312 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLvlGPTCommentary = slog.Level(-1)
	LogLvlOrigVerse     = slog.Level(-2)
	LogLvlTransport     = slog.Level(-3)
)

Variables

View Source
var DefaultSystemMessage = `` /* 1362-byte string literal not displayed */

Functions

func RepoComment

func RepoComment(cfg RepoCommentCfg) error

Types

type Client

type Client struct {
	Gnt           *sblgnt.SBLGNT
	Syn           *syntax.SBLGNTSyntax
	SystemMessage string
	Logger        *slog.Logger
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apikey string, gnt *sblgnt.SBLGNT, syn *syntax.SBLGNTSyntax) (*Client, error)

func (*Client) GetCommentary

func (gpt *Client) GetCommentary(ref commentary.Ref) ([]byte, error)

type MinNode

type MinNode struct {
	Cat     string    `json:"Cat"`
	Head    string    `json:"Head,omitempty"`
	Rule    string    `json:"Rule,omitempty"`
	ClType  string    `json:"ClType,omitempty"`
	Lemma   string    `json:"Lemma,omitempty"`
	Number  string    `json:"Num,omitempty"`
	Type    string    `json:"Type,omitempty"`
	Case    string    `json:"Case,omitempty"`
	Gender  string    `json:"MFN,omitempty"`
	Content string    `json:"Content,omitempty"`
	N       []MinNode `json:"N,omitempty"`
}

type MinSyntax

type MinSyntax struct {
	Ref string // Minimized reference for the whole sentence tree
	N   MinNode
}

func GetSyntax

func GetSyntax(syn *syntax.SBLGNTSyntax, ref commentary.Ref) ([]MinSyntax, error)

type NullHandler

type NullHandler struct{}

func (*NullHandler) Enabled

func (n *NullHandler) Enabled(context.Context, slog.Level) bool

func (*NullHandler) Handle

func (*NullHandler) WithAttrs

func (n *NullHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*NullHandler) WithGroup

func (n *NullHandler) WithGroup(name string) slog.Handler

type RepoCommentCfg

type RepoCommentCfg struct {
	Gpt            *Client
	Repo           *commentary.CommentaryRepo // Should already be Open
	Book           sblgnt.BookName
	Chapter, Verse int
	Fake           bool // Generate filler for testing rather than actually querying GPT
	Regenerate     bool // Regenerate existing verses (default is to skip existing)
	Workers        int
}

Jump to

Keyboard shortcuts

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