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

Method userPrompt

runtime/ai/develop_file.go:143–175  ·  view source on GitHub ↗
(ctx context.Context, args *DevelopFileArgs)

Source from the content-addressed store, hash-verified

141}
142
143func (t *DevelopFile) userPrompt(ctx context.Context, args *DevelopFileArgs) (string, error) {
144 // Get default OLAP info
145 olapInfo, err := defaultOLAPInfo(ctx, t.Runtime, GetSession(ctx).InstanceID())
146 if err != nil {
147 return "", err
148 }
149
150 // Prepare template data.
151 session := GetSession(ctx)
152 data := map[string]any{
153 "path": args.Path,
154 "type": args.Type,
155 "prompt": args.Prompt,
156 "ai_instructions": session.ProjectInstructions(),
157 "default_olap_info": olapInfo,
158 }
159
160 // Generate the user prompt
161 return executeTemplate(`
162You should develop a Rill project file based on the following task description:
163- Develop file at path: {{ .path }}
164{{ if .type }}- The file should be of type: {{ .type }}{{ end }}
165- Task description: {{ .prompt }}
166
167Here is some important context:
168- You are running as a sub-agent of a larger developer agent. Stay aligned on your specific task and avoid extra discovery.
169- When you call 'write_file', if it returns a parse or reconcile error, do your best to fix the issue and try again. If you think the error is unrelated to the current path, let the parent agent know to handle it.
170
171Here is some additional context that may or may not be relevant to your task:
172- Info about the project's default OLAP connector: {{ .default_olap_info }}.
173{{ if .ai_instructions }}- The user has configured global additional instructions for you. They may not relate to the current request, and may not even relate to your work as a data engineer agent. Only use them if you find them relevant. They are: {{ .ai_instructions }}{{ end }}
174`, data)
175}

Callers 1

HandlerMethod · 0.95

Calls 5

defaultOLAPInfoFunction · 0.85
GetSessionFunction · 0.85
InstanceIDMethod · 0.80
ProjectInstructionsMethod · 0.80
executeTemplateFunction · 0.70

Tested by

no test coverage detected