withSystemPrompt

fun withSystemPrompt(prompt: String, llm: LLModel = OpenAIModels.Chat.GPT4o, id: String = "koog-agents", maxAgentIterations: Int = 3): AIAgentConfigBase(source)

Creates an AI agent configuration with a specified system prompt.

This function initializes an instance of AIAgentConfig using the provided system-level prompt and other optional parameters, such as the language model, configuration ID, and maximum agent iterations.

Return

An instance of AIAgentConfigBase representing the AI agent configuration with the specified parameters.

Parameters

prompt

The content of the system prompt to define the context and instructions for the AI agent.

llm

The Large Language Model (LLM) to be used for the AI agent. Defaults to OpenAIModels.Chat.GPT4o.

id

The identifier for the agent configuration. Defaults to "koog-agents".

maxAgentIterations

The maximum number of iterations the agent can perform to avoid infinite loops. Defaults to 3.