promptdb

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package promptdb 在本地 SQLite 中保存 Playground 对话

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store 读写对话库

func Open

func Open(path string) (*Store, error)

Open 打开或创建对话库

func (*Store) Close

func (s *Store) Close() error

Close 关闭对话库

func (*Store) DeletePrompt

func (s *Store) DeletePrompt(ctx context.Context, id string) error

DeletePrompt 删除一份对话,不存在时返回 api.ErrPromptNotFound

func (*Store) Prompt

func (s *Store) Prompt(ctx context.Context, id string) (api.Prompt, error)

Prompt 读取一份对话,不存在时返回 api.ErrPromptNotFound

func (*Store) Prompts

func (s *Store) Prompts(ctx context.Context) ([]api.PromptSummary, error)

Prompts 按更新时间倒序列出全部对话

func (*Store) SavePrompt

func (s *Store) SavePrompt(ctx context.Context, prompt api.Prompt) (api.PromptSummary, error)

SavePrompt 创建或覆盖一份对话,保留首次创建时间

Jump to

Keyboard shortcuts

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