Hi, I'm struggling to figure out why exporting files/directories from a workspace of an LLM instance seems to be not working. This is a the dagger module I have (where builderWorkspace is similar to the toyWorkspace example, with read/write tools):
@func()
async exportTest(repository: Directory): Promise<Container> {
const workspace = dag.builderWorkspace(repository);
let llm = dag
.llm()
.withBuilderWorkspace(workspace)
.withPrompt("Write the text `Hello world` to `/hello.txt`");
const content = await llm.builderWorkspace().container().file("/hello.txt").contents();
console.log("Verifying the content of hello.txt: ", content);
await llm.builderWorkspace().container().file("/hello.txt").export("./hello.txt");
console.log("The above line seems to not work");
// returning the container just for debugging purposes
return llm.builderWorkspace().container();
}
The export line seems to not do anything whether I call export-test from the interactive terminal or directly from shell. This is the output from a shell run:
❯ dagger call --progress plain export-test --repository .
<omitted irrelevant output>
116 : File.export(path: "./hello.txt"): String!
117 : │ export file /hello.txt to host ./hello.txt
117 : │ export file /hello.txt to host ./hello.txt DONE [0.0s]
116 : File.export DONE [0.0s]
115 : Container.file DONE [0.1s]
118 : File.contents: String!
118 : [0.0s] | Hello world
118 : File.contents DONE [0.0s]
90 : ForgeBuildAgent.exportTest(
90 : │ │ repository: Host.directory(include: ["./dagger.json", "./**/*"], path: "/Users/jet/Development/forge"): Directory!
90 : │ ): Container!
90 : [8.4s] | Verifying the content of hello.txt: Hello world
90 : [8.4s] | The above line seems to not work
90 : ForgeBuildAgent.exportTest DONE [8.5s]
Am I exporting the file to the dagger runtime container or the LLM container, instead of host? Appreciate any pointers and help! Thank you!