StreamingFileReferenceContent Class
Streaming File reference content.
Note: This class is experimental and may change in the future.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Inheritance
-
StreamingFileReferenceContent
Constructor
StreamingFileReferenceContent(*, inner_content: Any | None = None, ai_model_id: str | None = None, metadata: dict[str, Any] = None, content_type: Literal[ContentTypes.STREAMING_FILE_REFERENCE_CONTENT] = 'streaming_file_reference', file_id: str | None = None)
Keyword-Only Parameters
Name | Description |
---|---|
inner_content
Required
|
|
ai_model_id
Required
|
|
metadata
Required
|
|
content_type
|
Default value: streaming_file_reference
|
file_id
Required
|
|
Methods
from_element |
Create an instance from an Element. |
to_dict |
Convert the instance to a dictionary. |
to_element |
Convert the file reference content to an Element. |
from_element
Create an instance from an Element.
from_element(element: Element) -> _T
Parameters
Name | Description |
---|---|
element
Required
|
|
to_dict
Convert the instance to a dictionary.
to_dict() -> dict[str, Any]
to_element
Convert the file reference content to an Element.
to_element() -> Element
Attributes
model_computed_fields
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}
model_config
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'populate_by_name': True, 'validate_assignment': True}
model_fields
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.fields from Pydantic V1.
model_fields: ClassVar[Dict[str, FieldInfo]] = {'ai_model_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'content_type': FieldInfo(annotation=Literal[<ContentTypes.STREAMING_FILE_REFERENCE_CONTENT: 'streaming_file_reference'>], required=False, default='streaming_file_reference', init=False), 'file_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'inner_content': FieldInfo(annotation=Union[Any, NoneType], required=False, default=None), 'metadata': FieldInfo(annotation=dict[str, Any], required=False, default_factory=dict)}
ai_model_id
ai_model_id: str | None
content_type
content_type: Literal[ContentTypes.STREAMING_FILE_REFERENCE_CONTENT]
file_id
file_id: str | None
inner_content
inner_content: Any | None
is_experimental
is_experimental = True
metadata
metadata: dict[str, Any]
tag
tag: ClassVar[str] = 'streaming_file_reference'