Skip to content

Commit

Permalink
We need to preserve imports as they are, the interface is:
Browse files Browse the repository at this point in the history
```
from outlines_core import Index, etc.
from outlines_core.json_schema import build_regex_from_schema
```
  • Loading branch information
yvan-sraka committed Feb 5, 2025
1 parent df00717 commit 9b7ffbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Additionally, project provides interfaces to integrate the crate's functionality
``` python
import json

from outlines_core import build_regex_from_schema
from outlines_core.json_schema import build_regex_from_schema
from outlines_core.guide import Guide, Index, Vocabulary

schema = {
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/bench_json_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from outlines_core import Index, Vocabulary, build_regex_from_schema
from outlines_core import Index, Vocabulary
from outlines_core.json_schema import build_regex_from_schema

simple_schema = """{
"$defs": {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re

import pytest
from outlines_core import build_regex_from_schema
from outlines_core.json_schema import build_regex_from_schema
from pydantic import BaseModel


Expand Down Expand Up @@ -32,7 +32,7 @@ def test_invalid_json():


def test_types_presence_and_not_emptyness():
from outlines_core import (
from outlines_core.json_schema import (
BOOLEAN,
DATE,
DATE_TIME,
Expand Down

0 comments on commit 9b7ffbe

Please sign in to comment.