#env input chaining papercut

1 messages · Page 1 of 1 (latest)

fathom harbor
#

hmm just ran into a DX papercut with setting up the environment

#
func (m *BotsBuildingBots) llm() *dagger.LLM {
    return dag.LLM(dagger.LLMOpts{Model: m.WriterModel}).
        WithWorkspace(dag.Workspace(dagger.WorkspaceOpts{
            Attempts:     m.Attempts,
            SystemPrompt: m.InitialPrompt,
        }))
}

func (m *BotsBuildingBots) SystemPrompt(ctx context.Context) (string, error) {
    return m.llm().
        WithSystemPrompt(`... snipped ...`).
        SetFile("README", m.Scheme).
        WithPrompt(`Read the README and generate the best system prompt for it. Keep going until all attempts succeed.`).
        Workspace().
        SystemPrompt(ctx)
}

the papercut: I had a shared helper that set up the LLM with an initial workspace, and then in other spots further set up the environment

but now you can only set the whole environment at once, you can't build it up incrementally

#

i could pluck off the current env, set a value, and pop it back in, of course

#

maybe i would have written this a different way if we were already in this scheme, so i'll try to roleplay that a bit

#

cc @inner wyvern

inner wyvern
#

llm() is the helper correct?

#

ha ha same pattern as Container.rootfs which led to all the convenience filesystem functions in Container