MCPcopy Create free account
hub / github.com/rilldata/rill / Load

Function Load

runtime/ai/instructions/instructions.go:41–49  ·  view source on GitHub ↗

Load loads a single instruction file by path (relative to the data directory). The path should include the file extension, e.g., "development.md" or "resources/model.md".

(path string, opts Options)

Source from the content-addressed store, hash-verified

39// Load loads a single instruction file by path (relative to the data directory).
40// The path should include the file extension, e.g., "development.md" or "resources/model.md".
41func Load(path string, opts Options) (*Instruction, error) {
42 fullPath := filepath.Join("data", path)
43 content, err := dataFS.ReadFile(fullPath)
44 if err != nil {
45 return nil, fmt.Errorf("failed to read instruction file %q: %w", path, err)
46 }
47
48 return parseInstruction(path, content, opts)
49}
50
51// LoadAll loads all instruction files from the data directory recursively.
52// Returns a map of file paths (relative to data directory) to their parsed instructions.

Callers 6

systemPromptMethod · 0.92
HandlerMethod · 0.92
TestLoadFunction · 0.85
TestLoadNestedFunction · 0.85
TestLoadNotFoundFunction · 0.85
TestLoadAgentsMDFunction · 0.85

Calls 2

parseInstructionFunction · 0.85
ErrorfMethod · 0.65

Tested by 4

TestLoadFunction · 0.68
TestLoadNestedFunction · 0.68
TestLoadNotFoundFunction · 0.68
TestLoadAgentsMDFunction · 0.68