Documentation
¶
Index ¶
- Constants
- Variables
- func IsValidEntityType(s string) bool
- type DataStore
- type Entity
- type EntityReferenceHint
- type EntityType
- type GenerateResult
- type Options
- type PromptType
- type Response
- type SqliteDataStore
- func (s *SqliteDataStore) AddEntity(e *Entity) error
- func (s *SqliteDataStore) Close() error
- func (s *SqliteDataStore) GetEntitiesByType(entityType EntityType) ([]*Entity, error)
- func (s *SqliteDataStore) GetEntityById(id string) (*Entity, error)
- func (s *SqliteDataStore) GetReferencedEntities(id string) ([]*Entity, error)
- func (s *SqliteDataStore) GetUnknownReferences() ([]*UnknownReference, error)
- type UnknownReference
Constants ¶
View Source
const ( Character = "character" Item = "item" Relic = "relic" Equipment = "equipment" Location = "location" Faction = "faction" Event = "event" World = "world" EventCatalyst = "event_catalyst" )
Variables ¶
View Source
var AllEntityTypes = []EntityType{ Character, Item, Relic, Equipment, Location, Faction, Event, World, EventCatalyst, }
View Source
var AllNonSingletonEntityTypes = []EntityType{ Character, Item, Relic, Equipment, Location, Faction, Event, }
View Source
var ResourcesFS embed.FS
Functions ¶
func IsValidEntityType ¶
Types ¶
type Entity ¶
type EntityReferenceHint ¶
type EntityReferenceHint struct { Id string `json:"id"` Type EntityType `json:"type"` ShortDesc string `json:"short_desc"` }
type EntityType ¶
type EntityType string
func RandomNonSingletonEntityType ¶
func RandomNonSingletonEntityType() EntityType
type GenerateResult ¶
func Generate ¶
func Generate(promptType PromptType, openAIToken string, dataStore DataStore, opts Options) (GenerateResult, error)
type PromptType ¶
type PromptType int
const ( PromptWorld PromptType = iota PromptCatalyst PromptEntity )
func ParsePromptType ¶
func ParsePromptType(str string) (PromptType, error)
func (PromptType) ToString ¶
func (pt PromptType) ToString() (string, error)
type Response ¶
type Response struct { Entity *Entity `json:"entity"` References []*EntityReferenceHint `json:"references"` }
type SqliteDataStore ¶
type SqliteDataStore struct {
// contains filtered or unexported fields
}
func MakeSqliteDataStore ¶
func MakeSqliteDataStore() *SqliteDataStore
func (*SqliteDataStore) AddEntity ¶
func (s *SqliteDataStore) AddEntity(e *Entity) error
func (*SqliteDataStore) Close ¶
func (s *SqliteDataStore) Close() error
func (*SqliteDataStore) GetEntitiesByType ¶
func (s *SqliteDataStore) GetEntitiesByType(entityType EntityType) ([]*Entity, error)
func (*SqliteDataStore) GetEntityById ¶
func (s *SqliteDataStore) GetEntityById(id string) (*Entity, error)
func (*SqliteDataStore) GetReferencedEntities ¶
func (s *SqliteDataStore) GetReferencedEntities(id string) ([]*Entity, error)
func (*SqliteDataStore) GetUnknownReferences ¶
func (s *SqliteDataStore) GetUnknownReferences() ([]*UnknownReference, error)
type UnknownReference ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.