Documentation ¶
Index ¶
- func MakeFixed[T Node](t T) T
- func Styled[I Node, T Node](n T, opts ...StyleOpt[I]) T
- type Bounds
- type BuildListStreamFunc
- type ChatMessage
- type ContainerBase
- func (n *ContainerBase) AsPmlParent() Parent
- func (n *ContainerBase) GetTokenBuffer() *rendering.TokenBuffer
- func (n *ContainerBase) Layout(ctx context.Context) error
- func (n *ContainerBase) LayoutChildren(ctx context.Context) error
- func (n *ContainerBase) NeedsLayout() bool
- func (n *ContainerBase) PmlContainer() *ContainerBase
- func (n *ContainerBase) RequestLayout()
- func (n *ContainerBase) Update(ctx context.Context) error
- type DynamicList
- type Leaf
- type LeafBase
- type Node
- type NodeBase
- func (n *NodeBase) GetBias() float64
- func (n *NodeBase) GetBoundsInLocal() Bounds
- func (n *NodeBase) GetBoundsInParent() Bounds
- func (n *NodeBase) GetEffectiveMaxLength() int
- func (n *NodeBase) GetEffectiveMinLength() int
- func (n *NodeBase) GetLayoutBounds() Bounds
- func (n *NodeBase) GetMaxLength() TokenLength
- func (n *NodeBase) GetMinLength() TokenLength
- func (n *NodeBase) GetRelevance() float64
- func (n *NodeBase) GetStage() *Stage
- func (n *NodeBase) GetTokenBuffer() *rendering.TokenBuffer
- func (n *NodeBase) GetTokenLength() int
- func (n *NodeBase) GetTokenLengthProperty() obsfx.ObservableValue[int]
- func (n *NodeBase) Init(self psi.Node, uuid string)
- func (n *NodeBase) InvalidateLayout()
- func (n *NodeBase) IsContainer() bool
- func (n *NodeBase) IsLeaf() bool
- func (n *NodeBase) IsMovable() bool
- func (n *NodeBase) IsResizable() bool
- func (n *NodeBase) IsVisible() bool
- func (n *NodeBase) PmlNode() Node
- func (n *NodeBase) PmlNodeBase() *NodeBase
- func (n *NodeBase) PmlParent() Parent
- func (n *NodeBase) RelevanceProperty() obsfx.Property[float64]
- func (n *NodeBase) RequestParentLayout()
- func (n *NodeBase) SetBias(bias float64)
- func (n *NodeBase) SetMaxLength(length TokenLength)
- func (n *NodeBase) SetMinLength(length TokenLength)
- func (n *NodeBase) SetMovable(movable bool)
- func (n *NodeBase) SetResizable(resizable bool)
- func (n *NodeBase) SetVisible(visible bool)
- func (n *NodeBase) Update(ctx context.Context) error
- type Parent
- type Stage
- type StyleOpt
- type TextNode
- type TokenLength
- func (s TokenLength) Add(other TokenLength) TokenLength
- func (s TokenLength) Div(other TokenLength) TokenLength
- func (s TokenLength) GetEffectiveLength(relFn func(float64) int, undefFn func() int) int
- func (s TokenLength) IsNegative() bool
- func (s TokenLength) IsNonNegative() bool
- func (s TokenLength) IsNonPositive() bool
- func (s TokenLength) IsPositive() bool
- func (s TokenLength) IsReal() bool
- func (s TokenLength) IsUnbounded() bool
- func (s TokenLength) IsZero() bool
- func (s TokenLength) Mod(other TokenLength) TokenLength
- func (s TokenLength) Mul(other TokenLength) TokenLength
- func (s TokenLength) MulInt(scalar int) TokenLength
- func (s TokenLength) MulScalar(scalar float64) TokenLength
- func (s TokenLength) String() string
- func (s TokenLength) Sub(other TokenLength) TokenLength
- func (s TokenLength) TokenCount() int
- type TokenUnit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bounds ¶
type Bounds struct { Position int Length TokenLength }
type BuildListStreamFunc ¶
type ChatMessage ¶
type ChatMessage struct { ContainerBase From obsfx.StringProperty Role obsfx.SimpleProperty[msn.Role] }
func MessageWithData ¶
func MessageWithData(from, to obsfx.ObservableValue[string], role obsfx.ObservableValue[msn.Role], content Node) *ChatMessage
type ContainerBase ¶
type ContainerBase struct { NodeBase // contains filtered or unexported fields }
func NewContainer ¶
func NewContainer() *ContainerBase
func (*ContainerBase) AsPmlParent ¶
func (n *ContainerBase) AsPmlParent() Parent
func (*ContainerBase) GetTokenBuffer ¶
func (n *ContainerBase) GetTokenBuffer() *rendering.TokenBuffer
func (*ContainerBase) LayoutChildren ¶
func (n *ContainerBase) LayoutChildren(ctx context.Context) error
func (*ContainerBase) NeedsLayout ¶
func (n *ContainerBase) NeedsLayout() bool
func (*ContainerBase) PmlContainer ¶
func (n *ContainerBase) PmlContainer() *ContainerBase
func (*ContainerBase) RequestLayout ¶
func (n *ContainerBase) RequestLayout()
type DynamicList ¶
type DynamicList struct { ContainerBase // contains filtered or unexported fields }
func NewDynamicList ¶
func NewDynamicList(streamBuilder BuildListStreamFunc) *DynamicList
type Node ¶
type Node interface { psi.Node PmlNodeBase() *NodeBase PmlNode() Node GetLayoutBounds() Bounds GetBoundsInLocal() Bounds GetBoundsInParent() Bounds IsResizable() bool SetResizable(resizable bool) IsVisible() bool SetVisible(visible bool) IsMovable() bool SetMovable(movable bool) GetMinLength() TokenLength SetMinLength(length TokenLength) GetMaxLength() TokenLength SetMaxLength(length TokenLength) GetRelevance() float64 GetBias() float64 SetBias(bias float64) GetTokenLength() int GetTokenLengthProperty() obsfx.ObservableValue[int] }
type NodeBase ¶
type NodeBase struct { psi.NodeBase LayoutBounds obsfx.Property[*Bounds] `json:"layout_bounds,omitempty"` Visible obsfx.BoolProperty `json:"visible,omitempty"` Resizable obsfx.BoolProperty `json:"resizable"` Movable obsfx.BoolProperty `json:"movable"` MinLength obsfx.SimpleProperty[TokenLength] `json:"min_length"` MaxLength obsfx.SimpleProperty[TokenLength] `json:"max_length"` Bias obsfx.DoubleProperty `json:"bias"` // contains filtered or unexported fields }
func (*NodeBase) GetBoundsInLocal ¶
func (*NodeBase) GetBoundsInParent ¶
func (*NodeBase) GetEffectiveMaxLength ¶
func (*NodeBase) GetEffectiveMinLength ¶
func (*NodeBase) GetLayoutBounds ¶
func (*NodeBase) GetMaxLength ¶
func (n *NodeBase) GetMaxLength() TokenLength
func (*NodeBase) GetMinLength ¶
func (n *NodeBase) GetMinLength() TokenLength
func (*NodeBase) GetRelevance ¶
func (*NodeBase) GetTokenBuffer ¶
func (n *NodeBase) GetTokenBuffer() *rendering.TokenBuffer
func (*NodeBase) GetTokenLength ¶
func (*NodeBase) GetTokenLengthProperty ¶
func (n *NodeBase) GetTokenLengthProperty() obsfx.ObservableValue[int]
func (*NodeBase) InvalidateLayout ¶
func (n *NodeBase) InvalidateLayout()
func (*NodeBase) IsContainer ¶
func (*NodeBase) IsResizable ¶
func (*NodeBase) PmlNodeBase ¶
func (*NodeBase) RequestParentLayout ¶
func (n *NodeBase) RequestParentLayout()
func (*NodeBase) SetMaxLength ¶
func (n *NodeBase) SetMaxLength(length TokenLength)
func (*NodeBase) SetMinLength ¶
func (n *NodeBase) SetMinLength(length TokenLength)
func (*NodeBase) SetMovable ¶
func (*NodeBase) SetResizable ¶
func (*NodeBase) SetVisible ¶
type Parent ¶
type Stage ¶
type Stage struct { MaxTokens int Tokenizer tokenizers.BasicTokenizer // contains filtered or unexported fields }
func NewStage ¶
func NewStage(root Parent, tokenizer tokenizers.BasicTokenizer) *Stage
type TextNode ¶
type TextNode struct { LeafBase Text obsfx.StringProperty `json:"text"` }
func TextWithData ¶
func TextWithData(binding obsfx.ObservableValue[string]) *TextNode
type TokenLength ¶
func NewTokenLength ¶
func NewTokenLength(amount float64, unit TokenUnit) TokenLength
func (TokenLength) Add ¶
func (s TokenLength) Add(other TokenLength) TokenLength
func (TokenLength) Div ¶
func (s TokenLength) Div(other TokenLength) TokenLength
func (TokenLength) GetEffectiveLength ¶
func (s TokenLength) GetEffectiveLength(relFn func(float64) int, undefFn func() int) int
func (TokenLength) IsNegative ¶
func (s TokenLength) IsNegative() bool
func (TokenLength) IsNonNegative ¶
func (s TokenLength) IsNonNegative() bool
func (TokenLength) IsNonPositive ¶
func (s TokenLength) IsNonPositive() bool
func (TokenLength) IsPositive ¶
func (s TokenLength) IsPositive() bool
func (TokenLength) IsReal ¶
func (s TokenLength) IsReal() bool
func (TokenLength) IsUnbounded ¶
func (s TokenLength) IsUnbounded() bool
func (TokenLength) IsZero ¶
func (s TokenLength) IsZero() bool
func (TokenLength) Mod ¶
func (s TokenLength) Mod(other TokenLength) TokenLength
func (TokenLength) Mul ¶
func (s TokenLength) Mul(other TokenLength) TokenLength
func (TokenLength) MulInt ¶
func (s TokenLength) MulInt(scalar int) TokenLength
func (TokenLength) MulScalar ¶
func (s TokenLength) MulScalar(scalar float64) TokenLength
func (TokenLength) String ¶
func (s TokenLength) String() string
func (TokenLength) Sub ¶
func (s TokenLength) Sub(other TokenLength) TokenLength
func (TokenLength) TokenCount ¶
func (s TokenLength) TokenCount() int
Click to show internal directories.
Click to hide internal directories.