| |
- 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 ResponseFormatFactory(builtins.object) |
|
Factory class that maps response format input to classes that can handle to_dict conversion. |
|
Static methods defined here:
- create_response_format_object(response_format)
- Map the response format to corresponding class.
Data descriptors defined here:
- __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.
Args:
name (str): The name to validate.
Returns:
str: The validated name.
Raises:
ValueError: If the name does not match the required pattern or exceeds the maximum length.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |