openvino_genai.StructuredOutputConfig#

class openvino_genai.StructuredOutputConfig#

Bases: pybind11_object

Structure to keep generation config parameters for structured output generation. It is used to store the configuration for structured generation, which includes the JSON schema and other related parameters.

Structured output parameters: json_schema: if set, the output will be a JSON string constraint by the specified json-schema. regex: if set, the output will be constraint by specified regex. grammar: if set, the output will be constraint by specified EBNF grammar. structural_tags_config: if set, the output will be constraint by specified structural tags configuration. compound_grammar:

if set, the output will be constraint by specified compound grammar. Compound grammar is a combination of multiple grammars that can be used to generate structured outputs. It allows for more complex and flexible structured output generation. The compound grammar a Union or Concat of several grammars, where each grammar can be a JSON schema, regex, EBNF, Union or Concat.

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig) -> None

Default constructor for StructuredOutputConfig

  1. __init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig, **kwargs) -> None

Constructor that initializes the structured output configuration with kwargs.

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getstate__()

Helper for pickle.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(*args, **kwargs)

Overloaded function.

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__(self)

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_pybind11_conduit_v1_

Attributes

__annotations__

compound_grammar

Compound grammar for structured output generation

grammar

Grammar for structured output generation

json_schema

JSON schema for structured output generation

regex

Regular expression for structured output generation

structural_tags_config

Configuration for structural tags in structured output generation

class Concat#

Bases: pybind11_object

__add__(self: object, arg0: object) openvino_genai.py_openvino_genai.StructuredOutputConfig.Concat#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(self: object, arg0: object, arg1: object) None#
__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

static __new__(arg0: object, arg1: object, arg2: object) openvino_genai.py_openvino_genai.StructuredOutputConfig.Concat#

Concat combines two grammars sequentially, e.g. “A B” means A followed by B

__or__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Union#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.Concat) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property left#
property right#
class EBNF#

Bases: pybind11_object

__add__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Concat#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.EBNF, arg0: str) None#

EBNF grammar building block for compound grammar configuration.

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__or__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Union#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.EBNF) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property value#
class JSONSchema#

Bases: pybind11_object

__add__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Concat#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.JSONSchema, arg0: str) None#

JSON schema building block for compound grammar configuration.

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__or__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Union#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.JSONSchema) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property value#
class Regex#

Bases: pybind11_object

__add__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Concat#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.Regex, arg0: str) None#

Regex building block for compound grammar configuration.

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__or__(self: object, arg0: object) ov::genai::StructuredOutputConfig::Union#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.Regex) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property value#
class Union#

Bases: pybind11_object

__add__(self: object, arg0: object) openvino_genai.py_openvino_genai.StructuredOutputConfig.Concat#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(self: object, arg0: object, arg1: object) None#
__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

static __new__(arg0: object, arg1: object, arg2: object) openvino_genai.py_openvino_genai.StructuredOutputConfig.Union#

Union combines two grammars in parallel, e.g. “A | B” means either A or B

__or__(self: object, arg0: object) openvino_genai.py_openvino_genai.StructuredOutputConfig.Union#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig.Union) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property left#
property right#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig) -> None

Default constructor for StructuredOutputConfig

  1. __init__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig, **kwargs) -> None

Constructor that initializes the structured output configuration with kwargs.

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__(self: openvino_genai.py_openvino_genai.StructuredOutputConfig) str#
__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property compound_grammar#

Compound grammar for structured output generation

property grammar#

Grammar for structured output generation

property json_schema#

JSON schema for structured output generation

property regex#

Regular expression for structured output generation

property structural_tags_config#

Configuration for structural tags in structured output generation