Disclaimer: I'm very new to Dagger, therefore I cannot tell if I'm hitting a bug or doing it wrong.
I'm developing a Dagger module in Go which interacts with LLMs from different models and providers, and I'm hitting authentication issues. I simplified my module to a single function and still hit the issue:
func (m *Example) Test(ctx context.Context, model string) (string, error) {
return dag.LLM().WithModel(model).WithPrompt("testing").LastReply(ctx)
}
Launching dagger and calling test "gpt-4o-mini" fails with a 401. However if I interact with the LLM from dagger shell first, and call my custom function second, then authentication works as expected:
> dagger
Dagger interactive shell. Type ".help" for more information. Press Ctrl+D to exit.
✔ llm | with-model "gpt-4o-mini" | with-prompt "test" | last-reply 0.8s
It looks like you're testing the system! How can I assist you today?
✔ test "gpt-4o-mini" 1.3s
It looks like you’re testing the chat! How can I assist you today?
My API keys are in a .env file at the root of my Dagger module. The version is the following:
> dagger version
dagger v0.18.2 (docker-image://registry.dagger.io/engine:v0.18.2) darwin/arm64