promptExecutor

@ApiStatus.Experimental
fun promptExecutor(llmClients: Map<LLMProvider, LLMClient>): JavaPromptExecutor(source)

Creates a new instance of JavaPromptExecutor using the provided map of LLM clients. The JavaPromptExecutor is configured with a delegated instance of MultiLLMPromptExecutor to handle prompts across multiple LLM providers.

Return

A configured JavaPromptExecutor instance ready to handle prompt execution.

Parameters

llmClients

A map where keys are LLMProvider instances representing the language model providers and values are LLMClient instances for interacting with the respective providers.


@ApiStatus.Experimental
fun promptExecutor(llmProvider: LLMProvider, llmClient: LLMClient): JavaPromptExecutor(source)

Creates an instance of JavaPromptExecutor by associating a specific LLMProvider with an LLMClient.

Return

A JavaPromptExecutor configured with the given provider and client.

Parameters

llmProvider

The LLMProvider instance specifying the large language model provider.

llmClient

The LLMClient instance used to execute prompts and interact with the specified provider.


Creates and returns a Java-friendly prompt executor that delegates prompt execution to a SingleLLMPromptExecutor.

Return

An instance of JavaPromptExecutor that wraps a SingleLLMPromptExecutor.

Parameters

llmClient

The client used for direct communication with a large language model (LLM) provider.