schemez 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- schemez/__init__.py +5 -1
- schemez/pydantic_types.py +42 -0
- {schemez-0.2.1.dist-info → schemez-0.2.2.dist-info}/METADATA +1 -1
- {schemez-0.2.1.dist-info → schemez-0.2.2.dist-info}/RECORD +6 -5
- {schemez-0.2.1.dist-info → schemez-0.2.2.dist-info}/WHEEL +0 -0
- {schemez-0.2.1.dist-info → schemez-0.2.2.dist-info}/licenses/LICENSE +0 -0
schemez/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "0.2.
|
1
|
+
__version__ = "0.2.2"
|
2
2
|
|
3
3
|
|
4
4
|
from schemez.schema import Schema
|
@@ -9,11 +9,15 @@ from schemez.schemadef.schemadef import (
|
|
9
9
|
ImportedSchemaDef,
|
10
10
|
InlineSchemaDef,
|
11
11
|
)
|
12
|
+
from schemez.pydantic_types import ModelIdentifier, ModelTemperature, MimeType
|
12
13
|
|
13
14
|
__all__ = [
|
14
15
|
"ImportedSchemaDef",
|
15
16
|
"InlineSchemaDef",
|
16
17
|
"JSONCode",
|
18
|
+
"MimeType",
|
19
|
+
"ModelIdentifier",
|
20
|
+
"ModelTemperature",
|
17
21
|
"PythonCode",
|
18
22
|
"Schema",
|
19
23
|
"SchemaDef",
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"""Custom field types with 'field_type' metadata for UI rendering hints."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Annotated
|
6
|
+
|
7
|
+
from pydantic import Field
|
8
|
+
|
9
|
+
|
10
|
+
ModelIdentifier = Annotated[
|
11
|
+
str,
|
12
|
+
Field(
|
13
|
+
json_schema_extra={"field_type": "model_identifier"},
|
14
|
+
pattern=r"^[a-zA-Z0-9\-]+(/[a-zA-Z0-9\-]+)*(:[\w\-\.]+)?$",
|
15
|
+
examples=["openai:gpt-o1-mini", "anthropic/claude-3-opus"],
|
16
|
+
description="Identifier for an AI model, optionally including provider.",
|
17
|
+
),
|
18
|
+
]
|
19
|
+
|
20
|
+
ModelTemperature = Annotated[
|
21
|
+
float,
|
22
|
+
Field(
|
23
|
+
json_schema_extra={"field_type": "temperature", "step": 0.1},
|
24
|
+
ge=0.0,
|
25
|
+
le=2.0,
|
26
|
+
description=(
|
27
|
+
"Controls randomness in model responses.\n"
|
28
|
+
"Lower values are more deterministic, higher values more creative"
|
29
|
+
),
|
30
|
+
examples=[0.0, 0.7, 1.0],
|
31
|
+
),
|
32
|
+
]
|
33
|
+
|
34
|
+
MimeType = Annotated[
|
35
|
+
str,
|
36
|
+
Field(
|
37
|
+
json_schema_extra={"field_type": "mime_type"},
|
38
|
+
pattern=r"^[a-z]+/[a-z0-9\-+.]+$",
|
39
|
+
examples=["text/plain", "application/pdf", "image/jpeg", "application/json"],
|
40
|
+
description="Standard MIME type identifying file formats and content types",
|
41
|
+
),
|
42
|
+
]
|
@@ -1,13 +1,14 @@
|
|
1
|
-
schemez/__init__.py,sha256=
|
1
|
+
schemez/__init__.py,sha256=R1tqWI3CF06HlDwunmw4TB-egVZ8sr1QmL9cr1eJ75k,565
|
2
2
|
schemez/code.py,sha256=usZLov9i5KpK1W2VJxngUzeetgrINtodiooG_AxN-y4,2072
|
3
3
|
schemez/convert.py,sha256=b6Sz11lq0HvpXfMREOqnnw8rcVg2XzTKhjjPNc4YIoE,4403
|
4
4
|
schemez/docstrings.py,sha256=kmd660wcomXzKac0SSNYxPRNbVCUovrpmE9jwnVRS6c,4115
|
5
5
|
schemez/helpers.py,sha256=Ee3wvFbt65ljhWDFdb6ACVUJK4KLjJFVzl4Le75pOBQ,5159
|
6
6
|
schemez/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
schemez/pydantic_types.py,sha256=kQRR9jVZ4vyLPPqxZSGcbP2gtcHUPUWsOR3tcPNM4X0,1197
|
7
8
|
schemez/schema.py,sha256=8nwLYW6J-RIMbKjt0BZK3zlktZZzBYXabGFlaQsecCQ,8538
|
8
9
|
schemez/schemadef/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
10
|
schemez/schemadef/schemadef.py,sha256=TLfcmCxPLZEvScxuIMlss0QDRWtQNhxLQ8z2i0Linoc,3794
|
10
|
-
schemez-0.2.
|
11
|
-
schemez-0.2.
|
12
|
-
schemez-0.2.
|
13
|
-
schemez-0.2.
|
11
|
+
schemez-0.2.2.dist-info/METADATA,sha256=mTyUilTrGhabvoQXB3roUwSWJwnNTV7CrSXAlTKmy90,5891
|
12
|
+
schemez-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
13
|
+
schemez-0.2.2.dist-info/licenses/LICENSE,sha256=AteGCH9r177TxxrOFEiOARrastASsf7yW6MQxlAHdwA,1078
|
14
|
+
schemez-0.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|