def test_import_outlines_core():
import outlines_core
assert hasattr(outlines_core, "Guide")
assert hasattr(outlines_core, "Index")
assert hasattr(outlines_core, "Vocabulary")
assert hasattr(outlines_core, "json_schema")
def test_import_json_schema_module():
from outlines_core import json_schema
assert hasattr(json_schema, "BOOLEAN")
assert hasattr(json_schema, "build_regex_from_schema")
def test_import_from_json_schema():
from outlines_core.json_schema import ( BOOLEAN,
DATE,
DATE_TIME,
EMAIL,
INTEGER,
NULL,
NUMBER,
STRING,
STRING_INNER,
TIME,
URI,
UUID,
WHITESPACE,
build_regex_from_schema,
)
assert BOOLEAN == "(true|false)"
assert callable(build_regex_from_schema)
def test_import_main_classes():
from outlines_core import Guide, Index, Vocabulary
assert Guide is not None
assert Index is not None
assert Vocabulary is not None
def test_import_rust_extension_directly():
from outlines_core import outlines_core
assert hasattr(outlines_core, "Guide")
assert hasattr(outlines_core, "Index")
assert hasattr(outlines_core, "Vocabulary")
assert hasattr(outlines_core, "json_schema")
def test_import_from_rust_extension():
from outlines_core.outlines_core import Guide, Index, Vocabulary
assert Guide is not None
assert Index is not None
assert Vocabulary is not None
def test_import_json_schema_from_rust_extension():
from outlines_core.outlines_core import json_schema
assert hasattr(json_schema, "BOOLEAN")
assert hasattr(json_schema, "build_regex_from_schema")