Package-level declarations

Types

Link copied to clipboard
class DefaultEmbeddingClient(client: HttpClient, embeddingClientProperties: DefaultEmbeddingClientProperties = DefaultEmbeddingClientProperties()) : EmbeddingClient

A default implementation of the EmbeddingClient.

Link copied to clipboard
data class DefaultEmbeddingClientProperties(val url: String = "http://localhost:11434/api/embeddings", val model: String = "all-minilm")

The default properties for the EmbeddingClient.

Link copied to clipboard
@Serializable
data class DefaultEmbeddingResponse(val embedding: List<Double>)

The default embedding response.

Link copied to clipboard
class DefaultVectorClient(vectorClientProperties: DefaultVectorClientProperties, embeddingClient: EmbeddingClient = DefaultEmbeddingClient( HttpClient(), DefaultEmbeddingClientProperties(), )) : VectorSearchClient, VectorSeedClient

The default implementation of the VectorSearchClient and VectorSeedClient.

Link copied to clipboard
data class DefaultVectorClientProperties(val seedJsonFilePath: String, val limit: Int = 5)

The default properties for the VectorClient.

Link copied to clipboard
data class DefaultVectorDocument(val text: String, val vector: List<Double>, val agentName: String)

The default vector document.

Link copied to clipboard
interface EmbeddingClient

An interface for a client that can embed text.

Link copied to clipboard
class EmbeddingClientException(message: String, reason: Exception? = null) : Exception

An exception thrown by the EmbeddingClient.

Link copied to clipboard

An embedding client which uses the OpenAI API to embed text.

Link copied to clipboard
class OpenAIEmbeddingClientProperties(val url: String = "https://api.openai.com/v1/embeddings", val model: String = "text-embedding-3-large", val batchSize: Int = 300, val apiKey: String = System.getenv("OPENAI_API_KEY"))

An implementation of the EmbeddingClient that uses OpenAI embeddings.

Link copied to clipboard
@Serializable
class OpenAIEmbeddingData(val embedding: List<Double>, val index: Int, val object: String)

Data class for the embedding response from the OpenAI API.

Link copied to clipboard
@Serializable
class OpenAIEmbeddingRequest(val model: String, val input: List<String>)

Request to embed text using the OpenAI API.

Link copied to clipboard
@Serializable
class OpenAIEmbeddingResponse(val object: String, val data: List<OpenAIEmbeddingData>, val model: String, val usage: OpenAIEmbeddingUsage)

Response from the OpenAI API for embedding text.

Link copied to clipboard
@Serializable
class OpenAIEmbeddingUsage constructor(val promptTokens: Int, val totalTokens: Int)

Usage class for the embedding response from the OpenAI API.

Link copied to clipboard
open class VectorAgentRoutingSpecsResolver(val agentRoutingSpecsProvider: AgentRoutingSpecsProvider, vectorSearchClient: VectorSearchClient = DefaultVectorClient( DefaultVectorClientProperties( seedJsonFilePath = System.getenv("VECTOR_SEED_JSON_FILE_PATH"), ), )) : AgentRoutingSpecsResolver

An implementation of AgentSpecResolver that resolves agent specs using a vector similarity search.

Link copied to clipboard
class VectorClientException(message: String, reason: Exception? = null) : Exception

An exception thrown by the VectorClient.

Link copied to clipboard

Constants for the VectorRoute.

Link copied to clipboard

A client for searching similar vectors.

Link copied to clipboard
open class VectorSearchClientRequest(val query: String, val context: Context)

A class representing a request to the VectorSearchClient.

Link copied to clipboard
open class VectorSearchClientResponse(val text: String, val agentName: String)

A class representing a response from the VectorSearchClient.

Link copied to clipboard

A client for seeding vectors.

Link copied to clipboard
@Serializable
open class VectorSeedRequest(val agentName: String, val text: String)

A class representing a request to the VectorSeedClient.

Functions

Link copied to clipboard

Calculates the cosine similarity between two vectors.