prompts

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPrompt = Prompt{
	ID:          "DefaultPrompt",
	Name:        "Native Default Prompt",
	Description: "Facilitates asking questions to the assistant.",
	Preferences: Preferences{
		Fast:      false,
		Reasoning: false,
	},
	Settings: Settings{
		SystemPrompt: `Provide responses that are clear and concise. Offer brief explanations if asked for, but avoid providing too much additional context or introductions unless explicitly requested.

# Output Format

- Short, direct answers.
- Brief explanations if necessary.
- No additional context or rephrasing unless requested.

# Notes

- Ensure all responses align with the user's demands for clarity and directness.
- Meet user requirements promptly without unnecessary elaboration.`,
	},
	Metadata: Metadata{
		CreatedAt: time.Date(2024, 10, 2, 0, 0, 0, 0, time.UTC),
		UpdatedAt: time.Date(2024, 10, 2, 0, 0, 0, 0, time.UTC),
		Version:   "0.1.0",
	},
}
View Source
var ErrPromptNotFound = errors.New("prompt not found")

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	CreatedAt time.Time `yaml:"created_at"`
	UpdatedAt time.Time `yaml:"updated_at"`
	Version   string    `yaml:"version"`
	Author    string    `yaml:"author"`
}

type Preferences

type Preferences struct {
	Fast      bool `yaml:"fast"`
	Reasoning bool `yaml:"reasoning"`
}

type Prompt

type Prompt struct {
	ID          string      `yaml:"id"`
	Name        string      `yaml:"name"`
	Description string      `yaml:"description"`
	Settings    Settings    `yaml:"settings"`
	Metadata    Metadata    `yaml:"metadata"`
	Preferences Preferences `yaml:"preferences"`
}

func AddPromptFromURL

func AddPromptFromURL(url string) (*Prompt, error)

func ListPrompts

func ListPrompts() ([]Prompt, error)

func LoadPrompt

func LoadPrompt(filename string) (*Prompt, error)

func (*Prompt) Save

func (p *Prompt) Save() error

Save a prompt to the disk TODO(nullswan): Use a store ID instead of the prompt ID

func (*Prompt) Validate

func (p *Prompt) Validate() error

type Settings

type Settings struct {
	SystemPrompt string  `yaml:"system_prompt"`
	PrePrompt    *string `yaml:"pre_prompt"`
}

Jump to

Keyboard shortcuts

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