{"id":9800,"library":"guardrails-hub-types","title":"Guardrails Hub Types","description":"Guardrails Hub Types provides Pydantic models and type definitions used across the Guardrails Hub ecosystem. It encapsulates data structures for hub manifests, workflows, and other configuration, ensuring consistency and validation. Currently at version 0.0.4, it is part of a rapidly evolving project, with frequent updates likely as Guardrails Hub matures.","status":"active","version":"0.0.4","language":"en","source_language":"en","source_url":"https://github.com/guardrails-ai/guardrails-hub/tree/main/guardrails-hub-types","tags":["types","guardrails","pydantic","llm","ai","schema","validation"],"install":[{"cmd":"pip install guardrails-hub-types","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Types are organized into submodules like 'models.hub' or 'models.workflow'.","wrong":"from guardrails_hub_types import HubManifest","symbol":"HubManifest","correct":"from guardrails_hub_types.models.hub import HubManifest"},{"note":"Ensure to import from the correct 'models' submodule path.","wrong":"from guardrails_hub_types.workflow import WorkflowManifest","symbol":"WorkflowManifest","correct":"from guardrails_hub_types.models.workflow import WorkflowManifest"}],"quickstart":{"code":"from guardrails_hub_types.models.hub import HubManifest\nfrom pydantic import ValidationError\n\n# Example of creating a HubManifest instance\nhub_data = {\n    \"name\": \"my-hub-rail\",\n    \"version\": \"0.1.0\",\n    \"description\": \"A simple rail for demonstration.\",\n    \"authors\": [\"John Doe <john.doe@example.com>\"],\n    \"tags\": [\"demo\", \"llm\"],\n    \"docs_url\": \"https://example.com/docs\",\n    \"config\": {\"type\": \"llm_rail\"},\n    \"inputs\": {\"prompt\": {\"type\": \"string\"}},\n    \"outputs\": {\"result\": {\"type\": \"string\"}}\n}\n\ntry:\n    manifest = HubManifest(**hub_data)\n    print(\"HubManifest created successfully!\")\n    print(f\"Manifest Name: {manifest.name}\")\n    print(f\"Manifest Version: {manifest.version}\")\nexcept ValidationError as e:\n    print(f\"Validation Error: {e}\")\n\n# Example of invalid data (missing required field 'name')\ninvalid_hub_data = {\n    \"version\": \"0.1.0\",\n    \"description\": \"Missing name.\"\n}\n\ntry:\n    invalid_manifest = HubManifest(**invalid_hub_data)\nexcept ValidationError as e:\n    print(f\"\\nFailed to create invalid manifest as expected: {e}\")","lang":"python","description":"This quickstart demonstrates how to import and instantiate a `HubManifest` using `guardrails-hub-types`. Since it uses Pydantic, data validation is automatic, and `ValidationError` is raised for malformed input, as shown with the invalid data example."},"warnings":[{"fix":"Always pin to specific versions (`guardrails-hub-types==0.0.4`) in production environments and review release notes carefully for updates.","message":"This library is version 0.0.x and is subject to rapid change. The API may not be stable and breaking changes are highly likely in future minor versions (e.g., 0.1.0, 0.2.0) before a 1.0.0 release.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Do not expect this library to provide functional components; it is a dependency for Guardrails Hub's data management, not an executable part of the Guardrails runtime itself.","message":"As a types-only library, `guardrails-hub-types` provides Pydantic models for data validation and structure, but does not contain any runtime logic or execution capabilities. It is intended for schema definition and validation.","severity":"gotcha","affected_versions":"*"},{"fix":"Always refer to the latest source code or documentation to confirm exact import paths. Stick to the documented `guardrails_hub_types.models.<submodule>.<Type>` pattern.","message":"The internal structure of the `models` submodules might change, leading to `ModuleNotFoundError` if you import directly from paths like `guardrails_hub_types.hub` instead of `guardrails_hub_types.models.hub`.","severity":"breaking","affected_versions":"All versions prior to 1.0.0"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"The types are organized into `models` submodules. Correct the import path to `from guardrails_hub_types.models.hub import HubManifest` (or `models.workflow`, etc.).","cause":"Attempting to import a type directly from the top-level package instead of its specific submodule.","error":"ModuleNotFoundError: No module named 'guardrails_hub_types.HubManifest'"},{"fix":"Review the schema for the specific type (e.g., `HubManifest`) to ensure all required fields are present and correctly formatted according to their defined types. Refer to the model's source code or generated schema for details.","cause":"Attempting to instantiate a Pydantic model with missing or incorrectly typed required fields.","error":"pydantic.error_wrappers.ValidationError: 1 validation error for HubManifest\\nname\\n  field required (type=value_error.missing)"}]}