Dagger
Search

llm-test-module

This module is necessary for testing allow-llm policy enforcement around git-sourced modules and is called by its parent LlmDirModuleDepender

Installation

dagger install github.com/cwlbraa/dagger-test-modules/llm-dir-module-depender/llm-test-module@2913d3fdd8d60272c786608f8577f903e7b78342

Entrypoint

Return Type
LlmTestModule !
Arguments
NameTypeDefault ValueDescription
modelString -No description provided
Example
dagger -m github.com/cwlbraa/dagger-test-modules/llm-dir-module-depender/llm-test-module@2913d3fdd8d60272c786608f8577f903e7b78342 call \
func (m *myModule) example() *LlmTestModule  {
	return dag.
			LlmTestModule()
}
@function
def example() -> dag.LlmTestModule:
	return (
		dag.llm_test_module()
	)
@func()
example(): LlmTestModule {
	return dag
		.llmTestModule()
}

Types

LlmTestModule 🔗

prompt() 🔗

access the LLM api in the most minimal way: prompt it, then retrieve history

Return Type
String !
Arguments
NameTypeDefault ValueDescription
stringArgString !-No description provided
Example
dagger -m github.com/cwlbraa/dagger-test-modules/llm-dir-module-depender/llm-test-module@2913d3fdd8d60272c786608f8577f903e7b78342 call \
 prompt --string-arg string
func (m *myModule) example(ctx context.Context, stringArg string) string  {
	return dag.
			LlmTestModule().
			Prompt(ctx, stringArg)
}
@function
async def example(string_arg: str) -> str:
	return await (
		dag.llm_test_module()
		.prompt(string_arg)
	)
@func()
async example(stringArg: string): Promise<string> {
	return dag
		.llmTestModule()
		.prompt(stringArg)
}

save() 🔗

this is a hack until we can return the LLM type and replay history

Return Type
String !
Arguments
NameTypeDefault ValueDescription
stringArgString !-No description provided
Example
dagger -m github.com/cwlbraa/dagger-test-modules/llm-dir-module-depender/llm-test-module@2913d3fdd8d60272c786608f8577f903e7b78342 call \
 save --string-arg string
func (m *myModule) example(ctx context.Context, stringArg string) string  {
	return dag.
			LlmTestModule().
			Save(ctx, stringArg)
}
@function
async def example(string_arg: str) -> str:
	return await (
		dag.llm_test_module()
		.save(string_arg)
	)
@func()
async example(stringArg: string): Promise<string> {
	return dag
		.llmTestModule()
		.save(stringArg)
}