From 78eb9081e86647d37ae41087d7d6a6a75754a2ad Mon Sep 17 00:00:00 2001 From: Aakash Thatte Date: Fri, 20 Dec 2024 23:35:53 +0530 Subject: [PATCH] add email and uri to bindings --- python/outlines_core/fsm/json_schema.py | 2 ++ python/outlines_core/fsm/outlines_core_rs.pyi | 2 ++ src/python_bindings/mod.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/python/outlines_core/fsm/json_schema.py b/python/outlines_core/fsm/json_schema.py index 555541fb..c879b1b4 100644 --- a/python/outlines_core/fsm/json_schema.py +++ b/python/outlines_core/fsm/json_schema.py @@ -2,12 +2,14 @@ BOOLEAN, DATE, DATE_TIME, + EMAIL, INTEGER, NULL, NUMBER, STRING, STRING_INNER, TIME, + URI, UUID, WHITESPACE, build_regex_from_schema, diff --git a/python/outlines_core/fsm/outlines_core_rs.pyi b/python/outlines_core/fsm/outlines_core_rs.pyi index 2bd6c82b..dae645e0 100644 --- a/python/outlines_core/fsm/outlines_core_rs.pyi +++ b/python/outlines_core/fsm/outlines_core_rs.pyi @@ -64,6 +64,8 @@ STRING_INNER: str TIME: str UUID: str WHITESPACE: str +EMAIL: str +URI: str class Vocabulary: """ diff --git a/src/python_bindings/mod.rs b/src/python_bindings/mod.rs index 84b8746d..f9c4936c 100644 --- a/src/python_bindings/mod.rs +++ b/src/python_bindings/mod.rs @@ -319,6 +319,8 @@ fn outlines_core_rs(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add("TIME", json_schema::TIME)?; m.add("UUID", json_schema::UUID)?; m.add("WHITESPACE", json_schema::WHITESPACE)?; + m.add("EMAIL", json_schema::EMAIL)?; + m.add("URI", json_schema::URI)?; m.add_function(wrap_pyfunction!(build_regex_from_schema_py, m)?)?; m.add_function(wrap_pyfunction!(to_regex_py, m)?)?;