#How to expose module functions to LLM?

1 messages · Page 1 of 1 (latest)

solar wind
#

I am [writing] terraform and want my agent to run a linter that I've installed in the custom docker container it's running. I explicitly prompt the (Sonnet 3.7) LLM to run the linter, but it makes the changes and makes no function calls to thin linters. Can you direct me for how to think about expose module functions to LLMs during it's development process?

Part of my prompt

## Your Capabilities

You have access to a workspace with the following tools:

- **Read files**: Access any file in the workspace
- **Write files**: Create or modify files
- **Execute commands**: Use the base_container to run commands like:
  - `trunk fmt` - Format code according to project standards
  - `trunk check` - Validate code quality, linting, and formatting

Full module code
https://gist.github.com/westonplatter/24a93c41d05c62e9113f187f343feb9f

Gist

GitHub Gist: instantly share code, notes, and snippets.

#

facepalm I was the issue - I updated my develop prompt to EXPLICITLY instruction the LLM to run my linting and security checks and it did,

#

Assignment Context

Please carefully think about the terraform coding task given to you.

Focus on making the adjustments in code you are tasked with.

  1. Make your code changes to the workspace
  2. ALWAYS execute: base_container.with_directory("/workspace", completed_workspace).with_workdir("/workspace").with_exec(["trunk", "fmt"]).directory("/workspace") to format the code
  3. ALWAYS execute: base_container.with_directory("/workspace", completed_workspace).with_workdir("/workspace").with_exec(["trunk", "check"]).stdout() to check code quality
  4. If trunk check reports issues, fix them and repeat steps 2-3
  5. Only return the completed workspace when trunk check passes with no errors
solar wind
#

When I used that content in my develop_prompt is add arbitrary execution to the list of methods

├─▶ select_methods(
│   ┆ methods: ["Directory.withNewFile", "Container.withDirectory", "Container.withWorkdir", "Container.withExec", "Container.directory", "Container.stdout", "Directory.file"]
│   ): String! 0.0s
│