Data Models API Reference¶
HoloDeck uses Pydantic models for all configuration validation. This section documents the complete data model hierarchy used throughout the platform.
Agent Models¶
Core agent configuration and instruction models.
Agent
¶
Bases: BaseModel
Agent configuration entity.
Root configuration for a single AI agent instance, defining model, instructions, tools, evaluations, and test cases.
name = Field(default=..., description='Agent identifier')
class-attribute
instance-attribute
¶
description = Field(default=None, description='Human-readable description')
class-attribute
instance-attribute
¶
instructions = Field(default=..., description='System instructions (file or inline)')
class-attribute
instance-attribute
¶
model = Field(default=..., description='LLM provider configuration')
class-attribute
instance-attribute
¶
tools = Field(default=None, description='Agent tools (vectorstore, function, mcp, prompt)')
class-attribute
instance-attribute
¶
evaluations = Field(default=None, description='Evaluation configuration')
class-attribute
instance-attribute
¶
test_cases = Field(default=None, description='Test scenarios')
class-attribute
instance-attribute
¶
Instructions
¶
Bases: BaseModel
System instructions specification (file or inline).
Represents the system prompt for an agent, supporting both file references and inline text.
model_post_init(__context)
¶
Validate file and inline mutual exclusivity.
Source code in src/holodeck/models/agent.py
49 50 51 52 53 54 | |
validate_file(v)
classmethod
¶
Validate file is not empty if provided.
Source code in src/holodeck/models/agent.py
33 34 35 36 37 38 39 | |
validate_inline(v)
classmethod
¶
Validate inline is not empty if provided.
Source code in src/holodeck/models/agent.py
41 42 43 44 45 46 47 | |
LLM Provider Models¶
Language model provider configuration for OpenAI, Azure OpenAI, and Anthropic.
ProviderEnum
¶
Bases: str, Enum
Supported LLM providers.
LLMProvider
¶
Bases: BaseModel
LLM provider configuration.
Specifies which LLM provider and model to use, along with model parameters.
provider = Field(..., description='LLM provider')
class-attribute
instance-attribute
¶
temperature = Field(default=0.3, description='Temperature (0.0-2.0)')
class-attribute
instance-attribute
¶
max_tokens = Field(default=1000, description='Maximum tokens to generate')
class-attribute
instance-attribute
¶
top_p = Field(default=None, description='Nucleus sampling parameter')
class-attribute
instance-attribute
¶
Tool Models¶
Five types of tools are supported: vectorstore, function, MCP, prompt, and plugins.
Tool
¶
Bases: BaseModel
Base tool model with discriminated union for subtypes.
VectorstoreTool
¶
Bases: BaseModel
Vectorstore tool for semantic search over documents.
validate_chunk_overlap(v)
classmethod
¶
Validate chunk_overlap is non-negative if provided.
Source code in src/holodeck/models/tool.py
254 255 256 257 258 259 260 | |
validate_chunk_size(v)
classmethod
¶
Validate chunk_size is positive if provided.
Source code in src/holodeck/models/tool.py
246 247 248 249 250 251 252 | |
validate_database(v)
classmethod
¶
Validate database is not empty string if provided as string.
Source code in src/holodeck/models/tool.py
236 237 238 239 240 241 242 243 244 | |
validate_embedding_dimensions(v)
classmethod
¶
Validate embedding_dimensions is positive and reasonable if provided.
Source code in src/holodeck/models/tool.py
280 281 282 283 284 285 286 287 288 289 | |
validate_min_similarity_score(v)
classmethod
¶
Validate min_similarity_score is between 0.0 and 1.0 if provided.
Source code in src/holodeck/models/tool.py
272 273 274 275 276 277 278 | |
validate_source(v)
classmethod
¶
Validate source is not empty.
Source code in src/holodeck/models/tool.py
228 229 230 231 232 233 234 | |
validate_structured_config()
¶
Validate structured data configuration.
When vector_field is set (structured data mode), id_field becomes required to enable record identification for upserts and deduplication.
Source code in src/holodeck/models/tool.py
214 215 216 217 218 219 220 221 222 223 224 225 226 | |
validate_top_k(v)
classmethod
¶
Validate top_k is a positive integer.
Source code in src/holodeck/models/tool.py
262 263 264 265 266 267 268 269 270 | |
FunctionTool
¶
Bases: BaseModel
Function tool for calling Python functions.
validate_file(v)
classmethod
¶
Validate file is not empty.
Source code in src/holodeck/models/tool.py
313 314 315 316 317 318 319 | |
validate_function(v)
classmethod
¶
Validate function is not empty.
Source code in src/holodeck/models/tool.py
321 322 323 324 325 326 327 | |
MCPTool
¶
Bases: BaseModel
MCP (Model Context Protocol) tool for standardized integrations.
Supports four transport types: - stdio (default): Local MCP servers via subprocess - sse: Remote servers via Server-Sent Events - websocket: Bidirectional WebSocket communication - http: Streamable HTTP transport
For stdio transport, only npx, uvx, or docker commands are allowed for security reasons.
validate_request_timeout(v)
classmethod
¶
Validate request_timeout is positive.
Source code in src/holodeck/models/tool.py
430 431 432 433 434 435 436 | |
validate_transport_fields()
¶
Validate transport-specific required fields.
- stdio transport requires 'command'
- sse, websocket, http transports require 'url'
Source code in src/holodeck/models/tool.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
validate_url_scheme(v)
classmethod
¶
Validate URL scheme for HTTP-based transports.
Allows http:// only for localhost, requires https:// for remote URLs. WebSocket URLs can use wss:// or ws://.
Source code in src/holodeck/models/tool.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | |
PromptTool
¶
Bases: BaseModel
Prompt-based tool for AI-powered semantic functions.
check_template_or_file(v, info)
classmethod
¶
Validate that exactly one of template or file is provided.
Source code in src/holodeck/models/tool.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 | |
validate_file(v)
classmethod
¶
Validate file is not empty if provided.
Source code in src/holodeck/models/tool.py
487 488 489 490 491 492 493 | |
validate_parameters(v)
classmethod
¶
Validate parameters is not empty.
Source code in src/holodeck/models/tool.py
495 496 497 498 499 500 501 502 503 | |
validate_template(v)
classmethod
¶
Validate template is not empty if provided.
Source code in src/holodeck/models/tool.py
479 480 481 482 483 484 485 | |
Evaluation Models¶
Metrics and evaluation framework configuration.
EvaluationMetric
¶
Bases: BaseModel
Evaluation metric configuration.
Represents a single evaluation metric with flexible model configuration, including per-metric LLM model overrides.
validate_custom_prompt(v)
classmethod
¶
Validate custom_prompt is not empty if provided.
Source code in src/holodeck/models/evaluation.py
121 122 123 124 125 126 127 | |
validate_enabled(v)
classmethod
¶
Validate enabled is boolean.
Source code in src/holodeck/models/evaluation.py
81 82 83 84 85 86 87 | |
validate_fail_on_error(v)
classmethod
¶
Validate fail_on_error is boolean.
Source code in src/holodeck/models/evaluation.py
89 90 91 92 93 94 95 | |
validate_metric(v)
classmethod
¶
Validate metric is not empty.
Source code in src/holodeck/models/evaluation.py
65 66 67 68 69 70 71 | |
validate_retry_on_failure(v)
classmethod
¶
Validate retry_on_failure is in valid range.
Source code in src/holodeck/models/evaluation.py
97 98 99 100 101 102 103 | |
validate_scale(v)
classmethod
¶
Validate scale is positive.
Source code in src/holodeck/models/evaluation.py
113 114 115 116 117 118 119 | |
validate_threshold(v)
classmethod
¶
Validate threshold is numeric if provided.
Source code in src/holodeck/models/evaluation.py
73 74 75 76 77 78 79 | |
validate_timeout_ms(v)
classmethod
¶
Validate timeout_ms is positive.
Source code in src/holodeck/models/evaluation.py
105 106 107 108 109 110 111 | |
EvaluationConfig
¶
Bases: BaseModel
Evaluation framework configuration.
Container for evaluation metrics with optional default model configuration. Supports standard EvaluationMetric, GEvalMetric (custom criteria), and RAGMetric (RAG pipeline evaluation).
Test Case Models¶
Test case definitions with multimodal file input support.
FileInput
¶
Bases: BaseModel
File input for multimodal test cases.
Represents a single file reference for test case inputs, supporting both local files and remote URLs with optional extraction parameters.
check_path_or_url(v, info)
classmethod
¶
Validate that exactly one of path or url is provided.
Source code in src/holodeck/models/test_case.py
38 39 40 41 42 43 | |
model_post_init(__context)
¶
Validate path and url mutual exclusivity after initialization.
Source code in src/holodeck/models/test_case.py
62 63 64 65 66 67 | |
validate_pages(v)
classmethod
¶
Validate pages are positive integers.
Source code in src/holodeck/models/test_case.py
54 55 56 57 58 59 60 | |
validate_type(v)
classmethod
¶
Validate file type is supported.
Source code in src/holodeck/models/test_case.py
45 46 47 48 49 50 51 52 | |
TestCaseModel
¶
Bases: BaseModel
Test case for agent evaluation.
Represents a single test scenario with input, optional expected output, expected tool usage, multimodal file inputs, and RAG context.
validate_files(v)
classmethod
¶
Validate files list is not empty if provided.
Source code in src/holodeck/models/test_case.py
117 118 119 120 121 122 123 | |
validate_ground_truth(v)
classmethod
¶
Validate ground_truth is not empty if provided.
Source code in src/holodeck/models/test_case.py
109 110 111 112 113 114 115 | |
validate_input(v)
classmethod
¶
Validate input is not empty.
Source code in src/holodeck/models/test_case.py
93 94 95 96 97 98 99 | |
validate_name(v)
classmethod
¶
Validate name is not empty if provided.
Source code in src/holodeck/models/test_case.py
101 102 103 104 105 106 107 | |
TestCase = TestCaseModel
module-attribute
¶
Global Configuration Models¶
Project-wide settings for vectorstore, deployment, and execution.
VectorstoreConfig
¶
Bases: BaseModel
Vectorstore configuration for global defaults.
Specifies connection details and options for a specific vectorstore backend.
validate_connection_string(v)
classmethod
¶
Validate connection_string is not empty.
Source code in src/holodeck/models/config.py
42 43 44 45 46 47 48 | |
validate_provider(v)
classmethod
¶
Validate provider is not empty.
Source code in src/holodeck/models/config.py
34 35 36 37 38 39 40 | |
DeploymentConfig
¶
Bases: BaseModel
Main deployment configuration model.
Attributes:
| Name | Type | Description |
|---|---|---|
runtime |
RuntimeType
|
Runtime type (currently only container) |
registry |
RegistryConfig
|
Container registry configuration |
target |
CloudTargetConfig
|
Cloud deployment target configuration |
protocol |
ProtocolType
|
API protocol type |
port |
Annotated[int, Field(ge=1, le=65535)]
|
Container port to expose |
health_check_path |
str
|
HTTP path for health checks (e.g., /health, /healthz) |
environment |
dict[str, str]
|
Environment variables for the container |
platform |
str
|
Target platform for container image (e.g., linux/amd64, linux/arm64) |
GlobalConfig
¶
Bases: BaseModel
Global configuration entity.
Configuration stored in ~/.holodeck/config.yaml for sharing defaults across multiple agents, including LLM providers, vectorstores, execution, and deployment settings.
Test Result Models¶
Models for representing test execution results and reports.
TestResult
¶
Bases: BaseModel
Result of executing a single test case.
Contains the test input, agent response, tool calls, metric results, and overall pass/fail status along with any errors encountered.
TestReport
¶
Bases: BaseModel
Complete test execution report.
Contains all test results, summary statistics, and metadata about the test run including agent name, version, and environment.
validate_results_count()
¶
Validate that summary total_tests matches results count.
Source code in src/holodeck/models/test_result.py
178 179 180 181 182 183 184 185 186 | |
Error Models¶
HoloDeck exception hierarchy for error handling.
HoloDeckError
¶
Bases: Exception
Base exception for all HoloDeck errors.
All HoloDeck-specific exceptions inherit from this class, enabling centralized exception handling and error tracking.
ConfigError(field, message)
¶
Bases: HoloDeckError
Exception raised for configuration errors.
This exception is raised when configuration loading or parsing fails. It includes field-specific information to help users identify and fix configuration issues.
Attributes:
| Name | Type | Description |
|---|---|---|
field |
The configuration field that caused the error |
|
message |
Human-readable error message describing the issue |
Initialize ConfigError with field and message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str
|
Configuration field name where error occurred |
required |
message
|
str
|
Descriptive error message |
required |
Source code in src/holodeck/lib/errors.py
26 27 28 29 30 31 32 33 34 35 | |
ValidationError(field, message, expected, actual)
¶
Bases: HoloDeckError
Exception raised for validation errors during configuration parsing.
Provides detailed information about what was expected versus what was received, enabling users to quickly understand and fix validation issues.
Attributes:
| Name | Type | Description |
|---|---|---|
field |
The field that failed validation |
|
message |
Description of the validation failure |
|
expected |
Human description of expected value/type |
|
actual |
The actual value that failed validation |
Initialize ValidationError with detailed information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str
|
Field that failed validation (can use dot notation for nested fields) |
required |
message
|
str
|
Description of what went wrong |
required |
expected
|
str
|
Human-readable description of expected value |
required |
actual
|
str
|
The actual value that failed |
required |
Source code in src/holodeck/lib/errors.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
FileNotFoundError(path, message)
¶
Bases: HoloDeckError
Exception raised when a configuration file is not found.
Includes the file path and helpful suggestions for resolving the issue.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
Path to the file that was not found |
|
message |
Human-readable error message |
Initialize FileNotFoundError with path and message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the file that was not found |
required |
message
|
str
|
Descriptive error message, optionally with suggestions |
required |
Source code in src/holodeck/lib/errors.py
88 89 90 91 92 93 94 95 96 97 | |
Related Documentation¶
- Configuration Loading: How to load and validate configurations
- Test Runner: Test execution framework using these models
- Evaluation Framework: Evaluation system using these models