Documentation ¶
Index ¶
- func ReservedKeys() []string
- type Block
- type BlockToken
- type BlockTokenKind
- type BlockType
- type CompiledPrompt
- type CompiledPromptC
- type Conf
- type DriverExtra
- type FileInfo
- type ParsedBlock
- func (p *ParsedBlock) Compile(varMap map[string]string) (compiled string, exceptions []error, fatal bool)
- func (p *ParsedBlock) Formatted(prov provider.Privider) []string
- func (p *ParsedBlock) IsRef() bool
- func (p *ParsedBlock) ToJson() ([]byte, error)
- func (p *ParsedBlock) ToMap() map[string]any
- func (p *ParsedBlock) ToReferBlock(refProvider provider.Privider) (*ReferBlock, error)
- func (p *ParsedBlock) Type() BlockType
- type PromptC
- type ReferBlock
- type SharedInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReservedKeys ¶ added in v0.1.0
func ReservedKeys() []string
Types ¶
type BlockToken ¶
type BlockToken struct { Text string `json:"text"` Kind BlockTokenKind `json:"kind"` }
func TxTokens ¶ added in v0.1.0
func TxTokens(tokens []BlockToken, varMoveTx, vatToLiterTx map[string]string) []BlockToken
type BlockTokenKind ¶
type BlockTokenKind string
const BlockTokenKindLiter BlockTokenKind = "liter"
const BlockTokenKindReservedQuota BlockTokenKind = "reserved_quota"
const BlockTokenKindScript BlockTokenKind = "script"
const BlockTokenKindVar BlockTokenKind = "var"
func (BlockTokenKind) String ¶
func (b BlockTokenKind) String() string
type CompiledPrompt ¶
type CompiledPromptC ¶ added in v0.1.0
type CompiledPromptC struct { Fatal bool Prompts []CompiledPrompt CompiledVars map[string]string Exceptions []error }
func (*CompiledPromptC) OpenAIChatCompletionMessages ¶ added in v0.1.0
func (c *CompiledPromptC) OpenAIChatCompletionMessages(ignoreEmptyPrompt bool) []openai.ChatCompletionMessage
type Conf ¶
type Conf struct { DriverExtra Model string `json:"model,omitempty,default=gpt-3.5-turbo"` Provider string `json:"provider,omitempty,default=openai"` }
type DriverExtra ¶ added in v0.0.2
type ParsedBlock ¶
type ParsedBlock struct { Text string `json:"-"` VarList []string `json:"-"` Tokens []BlockToken `json:"tokens"` Extra map[string]any `json:"extra"` }
func (*ParsedBlock) Formatted ¶ added in v0.1.0
func (p *ParsedBlock) Formatted(prov provider.Privider) []string
func (*ParsedBlock) IsRef ¶ added in v0.1.0
func (p *ParsedBlock) IsRef() bool
func (*ParsedBlock) ToJson ¶
func (p *ParsedBlock) ToJson() ([]byte, error)
func (*ParsedBlock) ToMap ¶
func (p *ParsedBlock) ToMap() map[string]any
func (*ParsedBlock) ToReferBlock ¶ added in v0.1.0
func (p *ParsedBlock) ToReferBlock(refProvider provider.Privider) (*ReferBlock, error)
func (*ParsedBlock) Type ¶ added in v0.1.0
func (p *ParsedBlock) Type() BlockType
type PromptC ¶ added in v0.1.0
type PromptC struct { Vars map[string]string `json:"vars"` Prompts []string `json:"prompts"` VarConstraint map[string]interfaces.Variable `json:"-"` ParsedPrompt []*ParsedBlock `json:"-"` Exceptions []error `json:"-"` RefProvider provider.Privider `json:"-"` }
func ParseBasicPrompt ¶ added in v0.1.0
func ParseFile ¶
ParseFile @deprecated Deprecated: FunctionName is deprecated. Use ParsePromptC instead.
func ParsePromptC ¶ added in v0.1.0
func ParseUnstructuredFile ¶ added in v0.0.2
ParseUnstructuredFile @deprecated Deprecated: FunctionName is deprecated. Use ParseBasicPrompt instead.
func (*PromptC) Compile ¶ added in v0.1.0
func (f *PromptC) Compile(vars map[string]string) *CompiledPromptC
type ReferBlock ¶ added in v0.1.0
type ReferBlock struct { RefTo string `json:"ref"` VarMap map[string]string `json:"vars"` RefProvider provider.Privider `json:"-"` }
func (*ReferBlock) Compile ¶ added in v0.1.0
func (r *ReferBlock) Compile(vars map[string]string) ([]CompiledPrompt, []error)
type SharedInfo ¶ added in v0.1.0
type SharedInfo struct {}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.