Implementation:Elevenlabs Elevenlabs python LiteralJsonSchemaProperty: Difference between revisions
Auto-imported from implementations/Elevenlabs_Elevenlabs_python_LiteralJsonSchemaProperty.md |
Sync from local file |
||
| Line 120: | Line 120: | ||
== Related Pages == | == Related Pages == | ||
* [[Elevenlabs_Elevenlabs_python_UnitTestToolCallEvaluationModelInput]] | * [[Implementation:Elevenlabs_Elevenlabs_python_UnitTestToolCallEvaluationModelInput]] | ||
* [[Elevenlabs_Elevenlabs_python_UnitTestToolCallParameterEval]] | * [[Implementation:Elevenlabs_Elevenlabs_python_UnitTestToolCallParameterEval]] | ||
[[Category:Implementations]] | [[Category:Implementations]] | ||
Latest revision as of 10:37, 27 September 2026
| Attribute | Value |
|---|---|
| Page Type | Implementation |
| Package | elevenlabs |
| Module | elevenlabs.types.literal_json_schema_property |
| Class | LiteralJsonSchemaProperty |
| Base Class | UncheckedBaseModel |
| Source File | src/elevenlabs/types/literal_json_schema_property.py |
| Auto-Generated | Yes (Fern API Definition) |
Overview
Description
LiteralJsonSchemaProperty is a Pydantic-based data model representing a schema property for literal JSON types within the ElevenLabs platform. It defines how a tool parameter value is sourced, with four mutually exclusive value-sourcing strategies: LLM-provided (via description), dynamic variable (via dynamic_variable), system-provided (via is_system_provided), or constant value (via constant_value). Only one of these four fields should be set at a time.
Usage
This model is used when defining tool parameter schemas, particularly for API Integration Webhook tools. It specifies the JSON type of the property and how its value should be populated at runtime. The mutual exclusivity constraint on the value-sourcing fields means that each property must have exactly one source of its value: the LLM generates it based on a description, it comes from a dynamic variable, the system provides it automatically, or it is a fixed constant.
Code Reference
Source Location
src/elevenlabs/types/literal_json_schema_property.py
Class Signature
class LiteralJsonSchemaProperty(UncheckedBaseModel):
"""
Schema property for literal JSON types. IMPORTANT: Only ONE of the following
fields can be set: description (LLM provides value), dynamic_variable
(value from variable), is_system_provided (system provides value), or
constant_value (fixed value). These are mutually exclusive.
"""
...
Import Statement
from elevenlabs.types.literal_json_schema_property import LiteralJsonSchemaProperty
I/O Contract
| Field Name | Type | Required | Default | Description |
|---|---|---|---|---|
| type | LiteralJsonSchemaPropertyType | Yes | N/A | The JSON schema type of the property (e.g., string, number, boolean) |
| description | Optional[str] | No | None | The description of the property. When set, the LLM will provide the value based on this description. Mutually exclusive with dynamic_variable, is_system_provided, and constant_value |
| enum | Optional[List[str]] | No | None | List of allowed string values for string type parameters |
| is_system_provided | Optional[bool] | No | None | If true, the value will be populated by the system at runtime. Used by API Integration Webhook tools for templating. Mutually exclusive with description, dynamic_variable, and constant_value |
| dynamic_variable | Optional[str] | No | None | The name of the dynamic variable to use for this property's value. Mutually exclusive with description, is_system_provided, and constant_value |
| constant_value | Optional[LiteralJsonSchemaPropertyConstantValue] | No | None | A constant value to use for this property. Mutually exclusive with description, dynamic_variable, and is_system_provided |
Usage Examples
LLM-Provided Value
from elevenlabs.types.literal_json_schema_property import LiteralJsonSchemaProperty
# Define a property where the LLM provides the value
prop = LiteralJsonSchemaProperty(
type="string",
description="The customer's full name as provided in the conversation",
)
Constant Value Property
# Define a property with a fixed constant value
prop = LiteralJsonSchemaProperty(
type="string",
constant_value="support_ticket",
)
Enum-Constrained Property
# Define a string property with allowed values
prop = LiteralJsonSchemaProperty(
type="string",
description="The priority level of the request",
enum=["low", "medium", "high", "critical"],
)
Dynamic Variable Property
# Define a property sourced from a dynamic variable
prop = LiteralJsonSchemaProperty(
type="string",
dynamic_variable="user_email",
)
System-Provided Property
# Define a property populated by the system at runtime
prop = LiteralJsonSchemaProperty(
type="string",
is_system_provided=True,
)