| | |
- builtins.object
-
- ResponseFormatFactory
- Validator
- builtins.str(builtins.object)
-
- ResponseFormatType(builtins.str, enum.Enum)
- enum.Enum(builtins.object)
-
- ResponseFormatType(builtins.str, enum.Enum)
- gen_ai_hub.orchestration.models.base.JSONSerializable(abc.ABC)
-
- ResponseFormatJsonObject
- ResponseFormatJsonSchema
- ResponseFormatText
class ResponseFormatJsonSchema(gen_ai_hub.orchestration.models.base.JSONSerializable) |
| |
ResponseFormatJsonSchema(name, schema: object = None, description: Optional[str] = None, strict: bool = False)
Response format JSON Schema that the model output should adhere to. |
| |
- Method resolution order:
- ResponseFormatJsonSchema
- gen_ai_hub.orchestration.models.base.JSONSerializable
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, name, schema: object = None, description: Optional[str] = None, strict: bool = False)
- Initializes a ResponseFormatJsonSchema instance.
:param name: the name of the response format.
:type name: str
:param schema: the schema for the response format described as a JSON Schema object, defaults to None
:type schema: object, optional
:param description: A description of what the response format is for, defaults to None
:type description: Optional[str], optional
:param strict: Whether to enable strict schema adherence when generating the output, defaults to False
:type strict: bool, optional
- to_dict(self)
- Converts the ResponseFormatJsonSchema instance to a dictionary.
:return: A dictionary representation of the ResponseFormatJsonSchema.
:rtype: dict
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
- __annotations__ = {}
Data descriptors inherited from gen_ai_hub.orchestration.models.base.JSONSerializable:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class ResponseFormatType(builtins.str, enum.Enum) |
| |
ResponseFormatType(value, names=None, *, module=None, qualname=None, type=None, start=1)
Enumerates the supported response format.
Response format that the model output should adhere to. This is the same as the OpenAI definition.
Values:
TEXT: Response format as text
JSON_OBJECT: Response format as json object
JSON_SCHEMA: Response format as defined json schema |
| |
- Method resolution order:
- ResponseFormatType
- builtins.str
- enum.Enum
- builtins.object
Data and other attributes defined here:
- JSON_OBJECT = <ResponseFormatType.JSON_OBJECT: 'json_object'>
- JSON_SCHEMA = <ResponseFormatType.JSON_SCHEMA: 'json_schema'>
- TEXT = <ResponseFormatType.TEXT: 'text'>
Data descriptors inherited from enum.Enum:
- name
- The name of the Enum member.
- value
- The value of the Enum member.
Readonly properties inherited from enum.EnumMeta:
- __members__
- Returns a mapping of member name->value.
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.
|
class Validator(builtins.object) |
| |
A utility class for validating response format names.
This class provides methods to validate the names of response formats to ensure
they adhere to specified patterns and length constraints. |
| |
Static methods defined here:
- validate_name(name)
- Validates the name of the response format.
:param name: The name to validate.
:type name: str
:raises ValueError: If the name does not match the required pattern or exceeds the maximum length.
:return: The validated name.
:rtype: str
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |