Whatever message this page gives is out now! Go check it out!
EmbeddingModel(struct configuration)Parameter | Type | Required | Description |
configuration | Struct | Yes | Structure containing provider and model configuration. |
Provider | Required | Optional |
OpenAI | API Key Model Name | Base URL Dimension Organization ID Project ID User Batch Size Max Retries Timeout (ms) Log Requests Log Responses |
Azure OpenAI | API Key Deployment Name | Base URL Dimension Max Retries Timeout (ms) Log Requests Log Responses |
Mistral | API Key Model Name | Base URL Max Retries Timeout (ms) Log Requests Log Responses |
Ollama | Model Name | Base URL Max Retries Timeout (ms) Log Requests Log Responses |
Gemini | API Key Model Name | Base URL Dimension Max Retries Timeout (ms) Log Requests Log Responses |
Key | Type | Default | Description |
provider | String | - | Embedding provider. Examples: "openai", "azureOpenAI", "ollama". |
apiKey | String | - | API key or token for the provider (if required). |
baseUrl | String | - | Optional base endpoint URL (for self‑hosted or Azure endpoints). |
modelName | String | - | Embedding model identifier. Example: "text-embedding-3-small". |
dimension | Numeric | - | Expected embedding dimension (for validation). |
timeout | Numeric | 10000 | Request timeout in milliseconds. |
maxRetries | Numeric | 2 | Maximum retry attempts for transient failures. |
logRequests | Boolean | true | Whether to log outbound requests (for debugging). |
logResponses | Boolean | true | Whether to log responses (for debugging). |
metadata | Struct | {} | Optional key‑value metadata to tag embedding calls. |
<cfscript>
embeddingModelConfig = EmbeddingModel(
{
provider : "openAI",
modelName : "text-embedding-3-small",
apiKey : "#application.apiKey#"
}
)
//embeddingModelConfig.embed("The quick brown fox jumps over the lazy dog")
//writeDump(response)
// add a vector store
inMemoryClient=VectorStore({
provider:"inMemory"
});
// add a single item to vector store
response=inMemoryClient.add({
id: createUUID(),
embedding: embeddingModelConfig,
text: "ColdFusion is a powerful rapid application development platform",
metadata: {"category": "technology", "test": "add"}
})
writeDump(response)
</cfscript>