Package-level declarations

Types

Link copied to clipboard
class DefaultModelClient(defaultModelClientProperties: DefaultModelClientProperties, delegate: LangChainModelClient = LangChainModelClient(LangChainChatModelFactory.createClient(defaultModelClientProperties))) : ModelClient

The DefaultModelClient class is a default implementation of the ModelClient interface.

Link copied to clipboard
data class DefaultModelClientProperties(val openAiUrl: String = "https://api.openai.com/v1", val openAiApiKey: String, val model: String = "gpt-4o-mini", val maxTokens: Int = 200, val temperature: Double = 0.0, val format: String = "json_object", val apiKey: String? = openAiApiKey, val baseUrl: String = openAiUrl, val provider: String = "openai") : ModelClientProperties

The DefaultModelClientProperties data class represents the properties for the default model client.

Link copied to clipboard

This class is a default implementation of the ModelResponseProcessor interface.

Link copied to clipboard

Default implementation of ModelPromptProvider that provides a generic prompt for agent resolution. The prompt includes instructions for selecting the most suitable agent based on the agents' capabilities. This prompt is intended to be used as a fallback when a custom prompt is not provided. This prompt requires json mode to be enabled.

Link copied to clipboard
class ExternalModelPromptProvider(promptFilePath: String, agentRoutingSpecsListType: AgentRoutingSpecListType = AgentRoutingSpecListType.XML) : ModelPromptProvider
Link copied to clipboard

A factory class to create a Langchain4j language model client. The factory creates a client based on the given properties.

Link copied to clipboard
class LangChainModelClient(chatLanguageModel: ChatLanguageModel) : ModelClient

A model client that uses Langchain4j(https://docs.langchain4j.dev/) to call a language model.

Link copied to clipboard
class LLMAgentRoutingSpecsResolver(val agentRoutingSpecsProvider: AgentRoutingSpecsProvider, modelPromptProvider: ModelPromptProvider = DefaultModelPromptProvider(), modelClient: ModelClient = DefaultModelClient( DefaultModelClientProperties( openAiApiKey = System.getenv( "OPENAI_API_KEY", ), ), ), serializer: Json = Json { ignoreUnknownKeys = true isLenient = true }, modelClientResponseProcessor: ModelClientResponseProcessor = DefaultModelClientResponseProcessor()) : AgentRoutingSpecsResolver

An agent spec resolver that uses a language model to resolve agent specs.

Link copied to clipboard
interface ModelClient

The ModelClient interface represents a client that can call a model.

Link copied to clipboard
open class ModelClientProperties(val provider: String, val apiKey: String? = null, val baseUrl: String? = null, val model: String, val maxTokens: Int = 2000, val temperature: Double = 0.0, val format: String? = null, val topK: Int? = null, val topP: Double? = null)
Link copied to clipboard
@Serializable
open class ModelClientResponse(val agentName: String)

Represents a model client response.

Link copied to clipboard

This interface represents a model response processor.

Link copied to clipboard

Represents a model prompt provider.

Functions

Link copied to clipboard
fun generateAgentRoutingSpecsJson(agentRoutingSpecs: Set<AgentRoutingSpec>): String
Link copied to clipboard
fun generateAgentRoutingSpecsXml(agentRoutingSpecs: Set<AgentRoutingSpec>): String