text

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 5 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	resources.ResourceConfigBase `yaml:",inline"`
	Text                         string `yaml:"text" validate:"required"`
}

Config represents the uninitialized textual resource configuration from YAML.

func (*Config) Initialize

func (c *Config) Initialize(ctx context.Context) (resources.Resource, error)

Initialize computes the size of the text and returns an initialized textual resource.

func (*Config) ResourceConfigType

func (c *Config) ResourceConfigType() string

ResourceConfigType returns the resource type identifier.

func (*Config) SetDefaults

func (c *Config) SetDefaults()

SetDefaults applies system defaults for unspecified optional fields.

type Resource

type Resource struct {
	Config
	Size int64
	// contains filtered or unexported fields
}

Resource represents the initialized textual resource that returns plain text payloads.

func (*Resource) GetDescription added in v1.16.0

func (r *Resource) GetDescription() string

GetDescription returns the frontmatter description for a SKILL.md, and the config description otherwise.

func (*Resource) GetMimeType added in v1.16.0

func (r *Resource) GetMimeType() string

GetMimeType returns text/markdown for a SKILL.md, as SEP-2640 requires, and the configured MIME type otherwise.

func (*Resource) GetName added in v1.16.0

func (r *Resource) GetName() string

GetName returns the frontmatter name for a SKILL.md, and the config name otherwise.

func (*Resource) GetSize

func (r *Resource) GetSize() *int64

GetSize returns the pre-computed size of the text content.

func (*Resource) Read

func (r *Resource) Read(ctx context.Context, params map[string]any) (any, error)

Read retrieves the static text content.

func (*Resource) ToConfig

func (r *Resource) ToConfig() resources.ResourceConfig

ToConfig returns the underlying uninitialized configuration.

Jump to

Keyboard shortcuts

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