dndbot

package
v0.0.0-...-220f810 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandAdventures

func ExpandAdventures(client Client, adventure *Adventure, p progressor) error

func GenerateCoverPrompts

func GenerateCoverPrompts(client Client, adventure *Adventure) error

func GenerateCoversFromPrompts

func GenerateCoversFromPrompts(client ImageClient, adventure *Adventure, path string, progress progressor) error

func GenerateIllustrationPrompts

func GenerateIllustrationPrompts(client Client, adventure *Adventure) error

func GenerateIllustrationsFromPrompts

func GenerateIllustrationsFromPrompts(client ImageClient, adventure *Adventure, path string, progress progressor) error

func GenerateOnePageDungeons

func GenerateOnePageDungeons(client Client, adventure *Adventure) error

func GetCopyrightRemovalPrompt

func GetCopyrightRemovalPrompt() string

func GetExpandedAdventurePrompt

func GetExpandedAdventurePrompt(settingDetails string) string

func GetIllustrationPrompt

func GetIllustrationPrompt() string

func GetOnePageDungeonPrompt

func GetOnePageDungeonPrompt(settingDetails string) string

func RemoveCopyrightedMaterial

func RemoveCopyrightedMaterial(client Client, adventure *Adventure) error

func SaveToFiles

func SaveToFiles(adventure *Adventure, outputDir string) error

Types

type Adventure

type Adventure struct {
	Title           string
	Episodes        []Episode
	TableOfContents string
	OriginalPrompt  string
	Covers          []IllustrationPrompt
	Setting         string "PROMPT.md"
	Style           string "STYLE.md"
}

Adventure represents the complete story structure

func GenerateTableOfContents

func GenerateTableOfContents(client Client, prompt string, p progressor, setting, style string) (Adventure, error)

type ClaudeClient

type ClaudeClient struct {
	Client *anthropic.Client
	// contains filtered or unexported fields
}

func NewClaudeClient

func NewClaudeClient(apiKey string) *ClaudeClient

func (*ClaudeClient) SendMessage

func (c *ClaudeClient) SendMessage(systemPrompt, userPrompt string) (string, error)

type ClaudeRequest

type ClaudeRequest struct {
	Model    string    `json:"model"`
	Messages []Message `json:"messages"`
}

ClaudeRequest represents the API request structure

type ClaudeResponse

type ClaudeResponse struct {
	Content string `json:"content"`
}

ClaudeResponse represents the API response structure

type Client

type Client interface {
	SendMessage(systemPrompt, userPrompt string) (string, error)
}

type Config

type Config struct {
	APIKey     string
	OutputDir  string
	MaxRetries int
}

Configuration struct for API and other settings

type Episode

type Episode struct {
	Title          string
	Summary        string
	Tagline        string
	Characters     []string
	Location       string
	OnePageDungeon string
	FullAdventure  string
	Illustrations  []IllustrationPrompt
}

Episode represents a single adventure episode

func (*Episode) Text

func (e *Episode) Text() string

type HordeClient

type HordeClient struct {
	*horde.Client
}

func NewHordeClient

func NewHordeClient() *HordeClient

func (*HordeClient) ImageGenerate

func (c *HordeClient) ImageGenerate(prompt string, steps, width, height int, modelName string, progress progressor) ([]byte, error)

type IllustrationPrompt

type IllustrationPrompt struct {
	Description string
	Style       string
	IsMap       bool
}

IllustrationPrompt represents a Stable Diffusion prompt

type ImageClient

type ImageClient interface {
	ImageGenerate(prompt string, steps, width, height int, modelName string, progress progressor) ([]byte, error)
}

type LLMClient

type LLMClient struct {
	// client     *anthropic.Client
	http.Client
	// contains filtered or unexported fields
}

func NewLLMClient

func NewLLMClient(apiKey string) *LLMClient

func (*LLMClient) SendMessage

func (c *LLMClient) SendMessage(systemPrompt, userPrompt string) (string, error)

type LocalClient

type LocalClient struct{}

func (*LocalClient) ImageGenerate

func (l *LocalClient) ImageGenerate(prompt string, steps, width, height int, modelName string, progress progressor) ([]byte, error)

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type SDWebUIRequest

type SDWebUIRequest struct {
	Prompt           string                 `json:"prompt"`
	NegativePrompt   string                 `json:"negative_prompt,omitempty"`
	Steps            int                    `json:"steps"`
	Width            int                    `json:"width"`
	Height           int                    `json:"height"`
	CFGScale         float64                `json:"cfg_scale,omitempty"`
	BatchSize        int                    `json:"batch_size,omitempty"`
	OverrideSettings map[string]interface{} `json:"override_settings,omitempty"`
}

SDWebUIRequest represents the request structure for the Stable Diffusion WebUI API SDWebUIRequest represents the request structure for the Stable Diffusion WebUI API

type SDWebUIResponse

type SDWebUIResponse struct {
	Images []string `json:"images"`
	Info   string   `json:"info"`
	Error  string   `json:"error,omitempty"`
}

SDWebUIResponse represents the response structure from the Stable Diffusion WebUI API

Jump to

Keyboard shortcuts

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