gen_ai_hub.orchestration.models.response_format
index
/home/jenkins/agent/workspace/ation_generative-ai-hub-sdk_main/gen_ai_hub/orchestration/models/response_format.py

 
Modules
       
re

 
Classes
       
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 ResponseFormatJsonObject(gen_ai_hub.orchestration.models.base.JSONSerializable)
    Response format JSON Object that the model output should adhere to.
 
 
Method resolution order:
ResponseFormatJsonObject
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
to_dict(self)
Convert the object to a JSON-serializable dictionary.

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 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.
 
Args:
    name: The name of the response format.
    description: A description of what the response format is for.
    schema: A schema for the response format described as a JSON Schema object.
    strict: Whether to enable strict schema adherence when generating the output.
 
 
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)
Initialize self.  See help(type(self)) for accurate signature.
to_dict(self)
Convert the object to a JSON-serializable dictionary.

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 ResponseFormatText(gen_ai_hub.orchestration.models.base.JSONSerializable)
    Response format that the model output should adhere to.
 
 
Method resolution order:
ResponseFormatText
gen_ai_hub.orchestration.models.base.JSONSerializable
abc.ABC
builtins.object

Methods defined here:
to_dict(self)
Convert the object to a JSON-serializable dictionary.

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.
 
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)

 
Data
        Optional = typing.Optional