build

Builds and returns an instance of AIAgent configured according to the builder's settings.

This method finalizes the current configuration and constructs an AI agent. The agent is equipped with the specified execution strategy, tool registry, identifier, prompt, language model, and other optional configurations. If required fields, such as promptExecutor or llmModel, are not set, this method throws an exception.

Return

An instance of AIAgent with the configured state type.