MCPcopy Index your code
hub / github.com/dagger/dagger / WithPromptFile

Method WithPromptFile

core/llm.go:606–620  ·  view source on GitHub ↗

WithPromptFile is like WithPrompt but reads the prompt from a file

(ctx context.Context, file *File)

Source from the content-addressed store, hash-verified

604
605// WithPromptFile is like WithPrompt but reads the prompt from a file
606func (llm *LLM) WithPromptFile(ctx context.Context, file *File) (*LLM, error) {
607 srv, err := CurrentDagqlServer(ctx)
608 if err != nil {
609 return nil, err
610 }
611 fileRes, err := dagql.NewObjectResultForCurrentCall(ctx, srv, file)
612 if err != nil {
613 return nil, err
614 }
615 contents, err := file.Contents(ctx, fileRes, nil, nil)
616 if err != nil {
617 return nil, err
618 }
619 return llm.WithPrompt(string(contents)), nil
620}
621
622// WithoutMessageHistory removes all messages, leaving only the system prompts
623func (llm *LLM) WithoutMessageHistory() *LLM {

Callers

nothing calls this directly

Calls 4

WithPromptMethod · 0.95
CurrentDagqlServerFunction · 0.70
ContentsMethod · 0.45

Tested by

no test coverage detected