Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

feat(signature): add type validation for input fields (#9313)

Michael I.71493dba02ca
diff --git a/docs/docs/learn/programming/signatures.md b/docs/docs/learn/programming/signatures.md
index ce3717b28..403ca5ec8 100644
--- a/docs/docs/learn/programming/signatures.md
+++ b/docs/docs/learn/programming/signatures.md
@@ -204,6 +204,37 @@ class MyContainer:
signature = dspy.Signature("query: MyContainer.Query -> score: MyContainer.Score")
```
+### Type Checking for Input Fields
+
+DSPy automatically validates that the values you pass to input fields match the types specified in your signature. This works for both inline and class-based signatures.
+When there's a type mismatch, DSPy will log a warning.
+
+**Example: Type Mismatch Warning**
+
+```python
+# Define a signature expecting an integer as input
+class MathSignature(dspy.Signature):
+ """Perform a mathematical operation."""
+ number: int = dspy.InputField()
+ result: str = dspy.OutputField()
+
+predictor = dspy.Predict(MathSignature)
+
+# This will trigger a warning because we're passing a string instead of an int
+predictor(number="42") # Warning: Type mismatch for field 'number': expected int, but provided value is incompatible
+```
+**Disabling Type Checking**
+
+If you want to disable type mismatch warnings, you can turn off this feature:
+
+```python
+# Disable type mismatch warnings globally
+dspy.configure(warn_on_type_mismatch=False)
+
+predictor = dspy.Predict("number: int -> result: str")
+predictor(number="42") # No warning
+```
+
## Using signatures to build modules & compiling them
While signatures are convenient for prototyping with structured inputs/outputs, that's not the only reason to use them!
diff --git a/dspy/dsp/utils/settings.py b/dspy/dsp/utils/settings.py
index 91d25c145..b5f0c731b 100644
--- a/dspy/dsp/utils/settings.py
+++ b/dspy/dsp/utils/settings.py
@@ -34,6 +34,7 @@ DEFAULT_CONFIG = dotdict(
allow_tool_async_sync_conversion=False,
max_history_size=10000,
max_trace_size=10000,
+ warn_on_type_mismatch=True, # Whether to log warnings when a module's input type doesn't match the signature type.
)
# Global base configuration and owner tracking
diff --git a/dspy/predict/predict.py b/dspy/predict/predict.py
index 3fb1da53a..141f3a981 100644
--- a/dspy/predict/predict.py
+++ b/dspy/predict/predict.py
@@ -1,8 +1,10 @@
import logging
import random
+from typing import Any, Literal, get_args, get_origin
from pydantic import BaseModel
from pydantic_core import PydanticUndefined
+from typeguard import TypeCheckError, check_type
from dspy.adapters.chat_adapter import ChatAdapter
from dspy.clients.base_lm import BaseLM
@@ -13,6 +15,7 @@ from dspy.primitives.module import Module
from dspy.primitives.prediction import Prediction
from dspy.signatures.signature import Signature, ensure_signature
from dspy.utils.callback import BaseCallback
+from dspy.utils.constants import IS_TYPE_UNDEFINED
logger = logging.getLogger(__name__)
@@ -181,6 +184,35 @@ class Predict(Module, Parameter):
if k not in kwargs and v.default is not PydanticUndefined:
kwargs[k] = v.default
+ # Check and warn for extra fields not in signature
+ extra_fields = [k for k in kwargs if k not in signature.input_fields]
+ if extra_fields:
+ logger.warning(
+ "Input contains fields not in signature. These fields will be ignored: %s. "
+ "Expected fields: %s.",
+ extra_fields,
+ list(signature.input_fields.keys()),
+ )
+
+ # Validate input field types match signature
+ if settings.warn_on_type_mismatch:
+ for field_name, field_info in signature.input_fields.items():
+ if field_name in kwargs:
+ value = kwargs[field_name]
+ expected_type: type = field_info.annotation
+
+ if value is None or field_info.json_schema_extra.get(IS_TYPE_UNDEFINED, False):
+ continue
+
+ if not _is_value_compatible_with_type(value, expected_type):
+ logger.warning(
+ "Type mismatch for field '%s': expected %s based on given Signature, "
+ "but the provided value is incompatible: %s.",
+ field_name,
+ _get_type_name(expected_type),
+ value,
+ )
+
if not all(k in kwargs for k in signature.input_fields):
present = [k for k in signature.input_fields if k in kwargs]
missing = [k for k in signature.input_fields if k not in kwargs]
@@ -244,6 +276,44 @@ class Predict(Module, Parameter):
def __repr__(self):
return f"{self.__class__.__name__}({self.signature})"
+def _get_type_name(type_annotation) -> str:
+ """Helper method to get the name for a type annotation."""
+
+ origin = get_origin(type_annotation)
+ args = get_args(type_annotation)
+
+ if origin is None:
+ # Primitives like str, int, etc.
+ if hasattr(type_annotation, "__name__"):
+ return type_annotation.__name__
+ return str(type_annotation)
+
+ # Handle Literal types
+ if origin is Literal:
+ literal_values = ", ".join(repr(arg) for arg in args)
+ return f"Literal[{literal_values}]"
+
+ # Types like list[str], dict[str, int], generics, etc.
+ if args:
+ # Handle Ellipsis in tuples (e.g., tuple[int, ...])
+ args_str = ", ".join("..." if arg is ... else _get_type_name(arg) for arg in args)
+ origin_name = getattr(origin, "__name__", str(origin))
+ return f"{origin_name}[{args_str}]"
+
+ return getattr(origin, "__name__", str(origin))
+
+def _is_value_compatible_with_type(value: Any, expected: type) -> bool:
+ """Return True if the value matches the expected type hint."""
+ try:
+ # Special handle list[str] because we allow setting input type to str, however, invoking with a list thereof.
+ if expected is str and isinstance(value, list):
+ if all(isinstance(item, str) for item in value):
+ return True
+
+ check_type(value, expected)
+ return True
+ except TypeCheckError:
+ return False
def serialize_object(obj):
"""
diff --git a/dspy/signatures/field.py b/dspy/signatures/field.py
index a7029c413..070e6ca18 100644
--- a/dspy/signatures/field.py
+++ b/dspy/signatures/field.py
@@ -2,10 +2,12 @@ import warnings
import pydantic
+from dspy.utils.constants import IS_TYPE_UNDEFINED
+
# The following arguments can be used in DSPy InputField and OutputField in addition
# to the standard pydantic.Field arguments. We just hope pydanitc doesn't add these,
# as it would give a name clash.
-DSPY_FIELD_ARG_NAMES = ["desc", "prefix", "format", "parser", "__dspy_field_type"]
+DSPY_FIELD_ARG_NAMES = ["desc", "prefix", "format", "parser", "__dspy_field_type", IS_TYPE_UNDEFINED]
_DEPRECATED_FIELD_ARGS = {
"prefix": (
diff --git a/dspy/signatures/signature.py b/dspy/signatures/signature.py
index 096a75057..24e061c02 100644
--- a/dspy/signatures/signature.py
+++ b/dspy/signatures/signature.py
@@ -23,12 +23,13 @@ import sys
import types
import typing
from copy import deepcopy
-from typing import Any
+from typing import Any, Iterator
from pydantic import BaseModel, Field, create_model
from pydantic.fields import FieldInfo
from dspy.signatures.field import InputField, OutputField
+from dspy.utils.constants import IS_TYPE_UNDEFINED
def _default_instructions(cls) -> str:
@@ -165,6 +166,7 @@ class SignatureMeta(type(BaseModel)):
continue # Don't add types to non-field attributes
if not name.startswith("__") and name not in raw_annotations:
raw_annotations[name] = str
+ field.json_schema_extra[IS_TYPE_UNDEFINED] = True # Mark that the type was originally undefined in the signature
# Create ordered annotations dictionary that preserves field order
ordered_annotations = {name: raw_annotations[name] for name in field_order if name in raw_annotations}
# Add any remaining annotations that weren't in field_order
@@ -259,10 +261,10 @@ class SignatureMeta(type(BaseModel)):
class Signature(BaseModel, metaclass=SignatureMeta):
- ""
+ """"""
# Note: Don't put a docstring here, as it will become the default instructions
- # for any signature that doesn't define it's own instructions.
+ # for any signature that doesn't define its own instructions.
@classmethod
def with_instructions(cls, instructions: str) -> type["Signature"]:
@@ -506,7 +508,7 @@ class Signature(BaseModel, metaclass=SignatureMeta):
return signature_copy
-def ensure_signature(signature: str | type[Signature], instructions=None) -> type[Signature]:
+def ensure_signature(signature: str | type[Signature], instructions=None) -> None | type[Signature]:
if signature is None:
return None
if isinstance(signature, str):
@@ -602,33 +604,34 @@ def make_signature(
)
-def _parse_signature(signature: str, names=None) -> dict[str, tuple[type, Field]]:
+def _parse_signature(signature: str, names=None) -> dict[str, tuple[type, Any]]:
if signature.count("->") != 1:
raise ValueError(f"Invalid signature format: '{signature}', must contain exactly one '->'.")
inputs_str, outputs_str = signature.split("->")
fields = {}
- for field_name, field_type in _parse_field_string(inputs_str, names):
- fields[field_name] = (field_type, InputField())
- for field_name, field_type in _parse_field_string(outputs_str, names):
+ for field_name, field_type, is_type_undefined in _parse_field_string(inputs_str, names):
+ fields[field_name] = (field_type, InputField(IS_TYPE_UNDEFINED= is_type_undefined))
+ for field_name, field_type, _ in _parse_field_string(outputs_str, names):
fields[field_name] = (field_type, OutputField())
return fields
-def _parse_field_string(field_string: str, names=None) -> dict[str, str]:
+def _parse_field_string(field_string: str, names=None) -> Iterator[tuple[str, type, bool]]:
"""Extract the field name and type from field string in the string-based Signature.
It takes a string like "x: int, y: str" and returns a dictionary mapping field names to their types.
- For example, "x: int, y: str" -> [("x", int), ("y", str)]. This function utitlizes the Python AST to parse the
+ For example, "x: int, y: str" -> [("x", int), ("y", str)]. This function utilizes the Python AST to parse the
fields and types.
"""
args = ast.parse(f"def f({field_string}): pass").body[0].args.args
- field_names = [arg.arg for arg in args]
- types = [str if arg.annotation is None else _parse_type_node(arg.annotation, names) for arg in args]
- return zip(field_names, types, strict=False)
+ field_names: list[str] = [arg.arg for arg in args]
+ types_list: list[type] = [str if arg.annotation is None else _parse_type_node(arg.annotation, names) for arg in args]
+ is_type_undefined: list[bool] = [True if arg.annotation is None else False for arg in args]
+ return zip(field_names, types_list, is_type_undefined, strict=False)
def _parse_type_node(node, names=None) -> Any:
diff --git a/dspy/utils/constants.py b/dspy/utils/constants.py
new file mode 100644
index 000000000..44461c22a
--- /dev/null
+++ b/dspy/utils/constants.py
@@ -0,0 +1,2 @@
+# Used to indicate whether the type of a field in a signature is originally not defined.
+IS_TYPE_UNDEFINED = "IS_TYPE_UNDEFINED"
diff --git a/pyproject.toml b/pyproject.toml
index 9cac54195..b4aaf576f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -38,6 +38,7 @@ dependencies = [
"numpy>=1.26.0",
"xxhash>=3.5.0",
"gepa[dspy]==0.0.27",
+ "typeguard>=4.4.3",
]
[project.optional-dependencies]
diff --git a/tests/predict/test_predict.py b/tests/predict/test_predict.py
index b82da3b2f..16107f31b 100644
--- a/tests/predict/test_predict.py
+++ b/tests/predict/test_predict.py
@@ -1,6 +1,7 @@
import asyncio
import copy
import enum
+import logging
import time
import types
from datetime import datetime
@@ -810,7 +811,6 @@ def test_positional_arguments():
"your signature input fields: 'question'. For example: `predict(question=input_value, ...)`."
)
-
def test_error_message_on_invalid_lm_setup():
# No LM is loaded.
with pytest.raises(ValueError, match="No LM is loaded"):
@@ -1014,3 +1014,667 @@ def test_input_field_default_value():
user_message = lm.calls[0]["messages"][-1]["content"]
assert "DEFAULT_CONTEXT" in user_message
+
+def log_test_helper():
+ lm = DummyLM([{"answer": "test output"}])
+ dspy.configure(lm=lm)
+ dspy_logger = logging.getLogger("dspy")
+ dspy_logger.propagate = True
+
+def test_extra_fields_warning(caplog):
+ """Test that extra fields not in signature generate a warning."""
+ log_test_helper()
+
+ predict_instance = Predict("question -> answer")
+
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(question="test", extra_field="should warn", another="also warn")
+
+ # Check that warning was logged about extra fields
+ assert "not in signature" in caplog.text
+ assert "extra_field" in caplog.text
+
+
+def test_warning_images(caplog):
+ """Test whether type mismatch for images generates a warning."""
+ log_test_helper()
+
+ predict_instance = Predict("question:dspy.Image -> answer")
+
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(question=dspy.Image("https://example.com/image1.jpg"))
+
+ assert "Type mismatch" not in caplog.text
+
+ caplog.clear()
+
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(question="dog_image")
+
+ assert "Type mismatch for field 'question': expected Image" in caplog.text
+
+def test_type_mismatch_warning(caplog):
+ """Test that type mismatches in input fields generate a warning."""
+ log_test_helper()
+
+ class TypedSignature(dspy.Signature):
+ count: int = dspy.InputField()
+ name: str = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(TypedSignature)
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Pass a string where int is expected
+ predict_instance(count="not an int", name="test")
+
+ assert "Type mismatch for field 'count': expected int" in caplog.text
+
+
+def test_correct_types_no_warning(caplog):
+ """Test that correct types don't generate warnings."""
+ log_test_helper()
+
+ class TypedSignature(dspy.Signature):
+ count: int = dspy.InputField()
+ name: str = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(TypedSignature)
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+
+ caplog.clear()
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Pass correct types
+ predict_instance(count=42, name="test")
+
+ assert "not in signature" not in caplog.text
+ assert "Type mismatch" not in caplog.text
+
+
+def test_list_type_validation(caplog):
+ """Test type validation with list[str] types."""
+ log_test_helper()
+
+ class ComplexSignature(dspy.Signature):
+ items: list[str] = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(ComplexSignature)
+ lm = DummyLM([{"result": "test output 1"}, {"result": "test output 2"}])
+ dspy.configure(lm=lm)
+
+ # Test with wrong type
+ caplog.clear()
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(items="not a list")
+
+ assert "Type mismatch for field 'items': expected list" in caplog.text
+
+ # Test with correct type
+ caplog.clear()
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(items=["a", "b", "c"])
+
+ assert "Type mismatch for field 'items'" not in caplog.text
+
+
+def test_literal_type_validation(caplog):
+ """Test type validation with Literal types."""
+ from typing import Literal
+
+ log_test_helper()
+
+ class LiteralSignature(dspy.Signature):
+ status: Literal["pending", "approved", "rejected"] = dspy.InputField()
+ priority: Literal[1, 2, 3] = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(LiteralSignature)
+
+ # Test with correct literal values
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(status="approved", priority=2)
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect literal value for string
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(status="invalid", priority=2)
+
+ assert "Type mismatch for field 'status': expected Literal['pending', 'approved', 'rejected']" in caplog.text
+
+ # Test with incorrect literal value for int
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(status="approved", priority=5)
+
+ assert "Type mismatch for field 'priority': expected Literal[1, 2, 3]" in caplog.text
+
+
+def test_literal_union_type_validation(caplog):
+ """Test type validation with Literal types in Union."""
+ from typing import Literal
+
+ log_test_helper()
+
+ class UnionLiteralSignature(dspy.Signature):
+ mode: Literal["auto", "manual"] | None = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(UnionLiteralSignature)
+
+ # Test with valid literal value
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mode="auto")
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with None
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mode=None)
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with invalid value
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mode="invalid")
+
+ assert "Type mismatch for field 'mode'" in caplog.text
+
+
+def test_list_string(caplog):
+ """Test passing list of strings."""
+ log_test_helper()
+
+ class TypedSignature(dspy.Signature):
+ nameList: list[str] = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(TypedSignature)
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Pass list of strings
+ predict_instance(nameList=["Alice", "Bob", "Charlie"])
+
+ assert "Type mismatch" not in caplog.text
+
+ caplog.clear()
+
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Pass list of non strings
+ predict_instance(nameList=[1, 2, 3, None])
+
+ assert "Type mismatch for field 'nameList': expected list[str]" in caplog.text
+
+
+def test_nested_list_type_validation(caplog):
+ """Test type validation with list element types."""
+ log_test_helper()
+
+ class NestedListSignature(dspy.Signature):
+ numbers: list[int] = dspy.InputField()
+ names: list[str] = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(NestedListSignature)
+
+ # Test with correct element types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=[1, 2, 3], names=["alice", "bob"])
+
+ # Should not have type warnings for correct element types
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect element types in numbers
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=["1", "2", "3"], names=["alice", "bob"])
+
+ assert "Type mismatch for field 'numbers': expected list[int]" in caplog.text
+
+ # Test with incorrect element types in names
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=[1, 2, 3], names=[1, 2, 3])
+
+ assert "Type mismatch for field 'names': expected list[str]" in caplog.text
+
+ # Test with empty list (should be valid)
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=[], names=[])
+
+ assert "Type mismatch" not in caplog.text
+
+
+def test_nested_dict_type_validation(caplog):
+ """Test type validation with dict key and value types."""
+ log_test_helper()
+
+ class DictSignature(dspy.Signature):
+ mapping: dict[str, int] = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(DictSignature)
+
+ # Test with correct key-value types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mapping={"a": 1, "b": 2, "c": 3})
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect value types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mapping={"a": "1", "b": "2", "c": "3"})
+
+ assert "Type mismatch for field 'mapping': expected dict[str, int]" in caplog.text
+
+ # Test with incorrect key types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mapping={1: 1, 2: 2, 3: 3})
+
+ assert "Type mismatch for field 'mapping': expected dict[str, int]" in caplog.text
+
+
+def test_nested_tuple_type_validation(caplog):
+ """Test type validation with tuple types."""
+ log_test_helper()
+
+ class TupleSignature(dspy.Signature):
+ fixed_tuple: tuple[str, int, bool] = dspy.InputField()
+ var_tuple: tuple[int, ...] = dspy.InputField()
+ result: str = dspy.OutputField()
+
+ predict_instance = Predict(TupleSignature)
+
+ # Test with correct tuple types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=("hello", 42, True), var_tuple=(1, 2, 3, 4))
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect element types in fixed tuple
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=(123, 42, True), var_tuple=(1, 2, 3))
+
+ assert "Type mismatch for field 'fixed_tuple': expected tuple[str, int, bool]" in caplog.text
+
+ # Test with wrong length fixed tuple
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=("hello", 42), var_tuple=(1, 2, 3))
+
+ assert "Type mismatch for field 'fixed_tuple': expected tuple[str, int, bool]" in caplog.text
+
+ # Test with incorrect element types in variable tuple
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=("hello", 42, True), var_tuple=("a", "b", "c"))
+
+ assert "Type mismatch for field 'var_tuple': expected tuple[int, ...]" in caplog.text
+
+
+def test_literal_type_validation_string_signature(caplog):
+ """Test type validation with Literal types using string signatures."""
+ log_test_helper()
+
+ # Use string signature with type annotations
+ predict_instance = Predict("status:Literal['pending','approved','rejected'], priority:Literal[1,2,3] -> result")
+
+ # Test with correct literal values
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(status="approved", priority=2)
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect literal value for string
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(status="invalid", priority=2)
+
+ assert "Type mismatch for field 'status': expected Literal['pending', 'approved', 'rejected']" in caplog.text
+
+ # Test with incorrect literal value for int
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(status="approved", priority=5)
+
+ assert "Type mismatch for field 'priority': expected Literal[1, 2, 3]" in caplog.text
+
+
+def test_list_type_validation_string_signature(caplog):
+ """Test type validation with list element types using string signatures."""
+ log_test_helper()
+
+ # Use string signature with type annotations
+ predict_instance = Predict("numbers:list[int], names:list[str] -> result")
+
+ # Test with correct element types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=[1, 2, 3], names=["alice", "bob"])
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect element types in numbers
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=["1", "2", "3"], names=["alice", "bob"])
+
+ assert "Type mismatch for field 'numbers': expected list[int]" in caplog.text
+
+ # Test with incorrect element types in names
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=[1, 2, 3], names=[1, 2, 3])
+
+ assert "Type mismatch for field 'names': expected list[str]" in caplog.text
+
+ # Test with empty list (should be valid)
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(numbers=[], names=[])
+
+ assert "Type mismatch" not in caplog.text
+
+
+def test_dict_type_validation_string_signature(caplog):
+ """Test type validation with dict key and value types using string signatures."""
+ log_test_helper()
+
+ # Use string signature with type annotations
+ predict_instance = Predict("mapping:dict[str,int] -> result")
+
+ # Test with correct key-value types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mapping={"a": 1, "b": 2, "c": 3})
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect value types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mapping={"a": "1", "b": "2", "c": "3"})
+
+ assert "Type mismatch for field 'mapping': expected dict[str, int]" in caplog.text
+
+ # Test with incorrect key types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mapping={1: 1, 2: 2, 3: 3})
+
+ assert "Type mismatch for field 'mapping': expected dict[str, int]" in caplog.text
+
+
+def test_tuple_type_validation_string_signature(caplog):
+ """Test type validation with tuple types using string signatures."""
+ log_test_helper()
+
+ # Use string signature with type annotations
+ predict_instance = Predict("fixed_tuple:tuple[str,int,bool], var_tuple:tuple[int,...] -> result")
+
+ # Test with correct tuple types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=("hello", 42, True), var_tuple=(1, 2, 3, 4))
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect element types in fixed tuple
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=(123, 42, True), var_tuple=(1, 2, 3))
+
+ assert "Type mismatch for field 'fixed_tuple': expected tuple[str, int, bool]" in caplog.text
+
+ # Test with wrong length fixed tuple
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=("hello", 42), var_tuple=(1, 2, 3))
+
+ assert "Type mismatch for field 'fixed_tuple': expected tuple[str, int, bool]" in caplog.text
+
+ # Test with incorrect element types in variable tuple
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(fixed_tuple=("hello", 42, True), var_tuple=("a", "b", "c"))
+
+ assert "Type mismatch for field 'var_tuple': expected tuple[int, ...]" in caplog.text
+
+
+def test_union_type_validation_string_signature(caplog):
+ """Test type validation with Union types using string signatures."""
+ log_test_helper()
+
+ # Use string signature with type annotations
+ predict_instance = Predict("mode:Literal['auto','manual']|None -> result")
+
+ # Test with valid literal value
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mode="auto")
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with None
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mode=None)
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with invalid value
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(mode="invalid")
+
+ assert "Type mismatch for field 'mode'" in caplog.text
+
[email protected]("enable_type_warnings", [False, True])
+def test_basic_types_string_signature(caplog, enable_type_warnings):
+ """Test type validation with basic types using string signatures."""
+ log_test_helper()
+ dspy.configure(warn_on_type_mismatch=enable_type_warnings)
+ # Use string signature with type annotations
+ predict_instance = Predict("count:int, name:str -> result")
+
+ # Test with correct types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(count=42, name="test")
+
+ assert "Type mismatch" not in caplog.text
+
+ # Test with incorrect type for count
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(count="not an int", name="test")
+
+ if enable_type_warnings:
+ assert "Type mismatch for field 'count': expected int" in caplog.text
+ else:
+ assert "Type mismatch" not in caplog.text
+
+def test_untyped_string_signature(caplog):
+ """Test type validation with basic types using string signatures without type."""
+ log_test_helper()
+
+ # Use string signature without annotations
+ predict_instance = Predict("count, name -> result")
+
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Test with incorrect type for count and name
+ predict_instance(count="abc", name=123)
+
+ assert "Type mismatch" not in caplog.text
+
+
+def test_untyped_class_signature(caplog):
+ """Test type validation with basic types using class signature without type."""
+ log_test_helper()
+
+ # Use class signature with type annotations
+ class TestSignature(dspy.Signature):
+ count = dspy.InputField()
+ name = dspy.InputField()
+ result = dspy.OutputField()
+ predict_instance = Predict(TestSignature)
+
+ # Test with correct types
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Test with "unexpected" type for count and name
+ predict_instance(count="abc", name=123)
+
+ assert "Type mismatch" not in caplog.text
+
+def test_string_to_list_signature(caplog):
+ """Test type validation with string input field type where the module gets called with a list."""
+ log_test_helper()
+
+ # Use class signature with type annotations
+ class TestSignature(dspy.Signature):
+ name: str = dspy.InputField()
+ count = dspy.InputField()
+ result = dspy.OutputField()
+ predict_instance = Predict(TestSignature)
+
+ caplog.clear()
+ lm = DummyLM([{"result": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Test with a list of strings
+ predict_instance(name=["abc", "def", "geh"], count=123)
+
+ assert "Type mismatch" not in caplog.text
+
[email protected]("enable_type_warnings", [False, True])
+def test_custom_signature_types(caplog, enable_type_warnings):
+ """Test type validation with custom signature types."""
+ log_test_helper()
+ dspy.configure(warn_on_type_mismatch=enable_type_warnings)
+
+ class MyContainer:
+ class Query(pydantic.BaseModel):
+ text: str
+
+ signature = dspy.Signature("query: MyContainer.Query -> answer")
+ predict_instance = Predict(signature)
+
+ # Create an instance of the Query model
+ query_instance = MyContainer.Query(text="What is the capital of France?")
+
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ predict_instance(query=query_instance)
+
+ assert "Type mismatch" not in caplog.text
+
+ caplog.clear()
+ lm = DummyLM([{"answer": "test output"}])
+ dspy.configure(lm=lm)
+ with caplog.at_level(logging.WARNING, logger="dspy.predict.predict"):
+ # Test with an incorrect type
+ predict_instance(query="What is the capital of France?")
+
+ if enable_type_warnings:
+ assert "Type mismatch for field 'query': expected Query" in caplog.text
+ else:
+ assert "Type mismatch" not in caplog.text
diff --git a/uv.lock b/uv.lock
index 9833a30bb..a21af766a 100644
--- a/uv.lock
+++ b/uv.lock
@@ -751,6 +751,7 @@ dependencies = [
{ name = "requests" },
{ name = "tenacity" },
{ name = "tqdm" },
+ { name = "typeguard" },
{ name = "xxhash" },
]
@@ -829,6 +830,7 @@ requires-dist = [
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.3.0" },
{ name = "tenacity", specifier = ">=8.2.3" },
{ name = "tqdm", specifier = ">=4.66.1" },
+ { name = "typeguard", specifier = ">=4.4.3" },
{ name = "weaviate-client", marker = "extra == 'weaviate'", specifier = "~=4.5.4" },
{ name = "xxhash", specifier = ">=3.5.0" },
]
@@ -1032,7 +1034,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/92/db/b4c12cff13ebac2786f4f217f06588bccd8b53d260453404ef22b121fc3a/greenlet-3.2.3-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:1afd685acd5597349ee6d7a88a8bec83ce13c106ac78c196ee9dde7c04fe87be", size = 268977, upload-time = "2025-06-05T16:10:24.001Z" },
{ url = "https://files.pythonhosted.org/packages/52/61/75b4abd8147f13f70986df2801bf93735c1bd87ea780d70e3b3ecda8c165/greenlet-3.2.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:761917cac215c61e9dc7324b2606107b3b292a8349bdebb31503ab4de3f559ac", size = 627351, upload-time = "2025-06-05T16:38:50.685Z" },
{ url = "https://files.pythonhosted.org/packages/35/aa/6894ae299d059d26254779a5088632874b80ee8cf89a88bca00b0709d22f/greenlet-3.2.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:a433dbc54e4a37e4fff90ef34f25a8c00aed99b06856f0119dcf09fbafa16392", size = 638599, upload-time = "2025-06-05T16:41:34.057Z" },
- { url = "https://files.pythonhosted.org/packages/30/64/e01a8261d13c47f3c082519a5e9dbf9e143cc0498ed20c911d04e54d526c/greenlet-3.2.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:72e77ed69312bab0434d7292316d5afd6896192ac4327d44f3d613ecb85b037c", size = 634482, upload-time = "2025-06-05T16:48:16.26Z" },
{ url = "https://files.pythonhosted.org/packages/47/48/ff9ca8ba9772d083a4f5221f7b4f0ebe8978131a9ae0909cf202f94cd879/greenlet-3.2.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:68671180e3849b963649254a882cd544a3c75bfcd2c527346ad8bb53494444db", size = 633284, upload-time = "2025-06-05T16:13:01.599Z" },
{ url = "https://files.pythonhosted.org/packages/e9/45/626e974948713bc15775b696adb3eb0bd708bec267d6d2d5c47bb47a6119/greenlet-3.2.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:49c8cfb18fb419b3d08e011228ef8a25882397f3a859b9fe1436946140b6756b", size = 582206, upload-time = "2025-06-05T16:12:48.51Z" },
{ url = "https://files.pythonhosted.org/packages/b1/8e/8b6f42c67d5df7db35b8c55c9a850ea045219741bb14416255616808c690/greenlet-3.2.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:efc6dc8a792243c31f2f5674b670b3a95d46fa1c6a912b8e310d6f542e7b0712", size = 1111412, upload-time = "2025-06-05T16:36:45.479Z" },
@@ -1041,7 +1042,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/fc/2e/d4fcb2978f826358b673f779f78fa8a32ee37df11920dc2bb5589cbeecef/greenlet-3.2.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:784ae58bba89fa1fa5733d170d42486580cab9decda3484779f4759345b29822", size = 270219, upload-time = "2025-06-05T16:10:10.414Z" },
{ url = "https://files.pythonhosted.org/packages/16/24/929f853e0202130e4fe163bc1d05a671ce8dcd604f790e14896adac43a52/greenlet-3.2.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0921ac4ea42a5315d3446120ad48f90c3a6b9bb93dd9b3cf4e4d84a66e42de83", size = 630383, upload-time = "2025-06-05T16:38:51.785Z" },
{ url = "https://files.pythonhosted.org/packages/d1/b2/0320715eb61ae70c25ceca2f1d5ae620477d246692d9cc284c13242ec31c/greenlet-3.2.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:d2971d93bb99e05f8c2c0c2f4aa9484a18d98c4c3bd3c62b65b7e6ae33dfcfaf", size = 642422, upload-time = "2025-06-05T16:41:35.259Z" },
- { url = "https://files.pythonhosted.org/packages/bd/49/445fd1a210f4747fedf77615d941444349c6a3a4a1135bba9701337cd966/greenlet-3.2.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c667c0bf9d406b77a15c924ef3285e1e05250948001220368e039b6aa5b5034b", size = 638375, upload-time = "2025-06-05T16:48:18.235Z" },
{ url = "https://files.pythonhosted.org/packages/7e/c8/ca19760cf6eae75fa8dc32b487e963d863b3ee04a7637da77b616703bc37/greenlet-3.2.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:592c12fb1165be74592f5de0d70f82bc5ba552ac44800d632214b76089945147", size = 637627, upload-time = "2025-06-05T16:13:02.858Z" },
{ url = "https://files.pythonhosted.org/packages/65/89/77acf9e3da38e9bcfca881e43b02ed467c1dedc387021fc4d9bd9928afb8/greenlet-3.2.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29e184536ba333003540790ba29829ac14bb645514fbd7e32af331e8202a62a5", size = 585502, upload-time = "2025-06-05T16:12:49.642Z" },
{ url = "https://files.pythonhosted.org/packages/97/c6/ae244d7c95b23b7130136e07a9cc5aadd60d59b5951180dc7dc7e8edaba7/greenlet-3.2.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:93c0bb79844a367782ec4f429d07589417052e621aa39a5ac1fb99c5aa308edc", size = 1114498, upload-time = "2025-06-05T16:36:46.598Z" },
@@ -1050,7 +1050,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/f3/94/ad0d435f7c48debe960c53b8f60fb41c2026b1d0fa4a99a1cb17c3461e09/greenlet-3.2.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:25ad29caed5783d4bd7a85c9251c651696164622494c00802a139c00d639242d", size = 271992, upload-time = "2025-06-05T16:11:23.467Z" },
{ url = "https://files.pythonhosted.org/packages/93/5d/7c27cf4d003d6e77749d299c7c8f5fd50b4f251647b5c2e97e1f20da0ab5/greenlet-3.2.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:88cd97bf37fe24a6710ec6a3a7799f3f81d9cd33317dcf565ff9950c83f55e0b", size = 638820, upload-time = "2025-06-05T16:38:52.882Z" },
{ url = "https://files.pythonhosted.org/packages/c6/7e/807e1e9be07a125bb4c169144937910bf59b9d2f6d931578e57f0bce0ae2/greenlet-3.2.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:baeedccca94880d2f5666b4fa16fc20ef50ba1ee353ee2d7092b383a243b0b0d", size = 653046, upload-time = "2025-06-05T16:41:36.343Z" },
- { url = "https://files.pythonhosted.org/packages/9d/ab/158c1a4ea1068bdbc78dba5a3de57e4c7aeb4e7fa034320ea94c688bfb61/greenlet-3.2.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:be52af4b6292baecfa0f397f3edb3c6092ce071b499dd6fe292c9ac9f2c8f264", size = 647701, upload-time = "2025-06-05T16:48:19.604Z" },
{ url = "https://files.pythonhosted.org/packages/cc/0d/93729068259b550d6a0288da4ff72b86ed05626eaf1eb7c0d3466a2571de/greenlet-3.2.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0cc73378150b8b78b0c9fe2ce56e166695e67478550769536a6742dca3651688", size = 649747, upload-time = "2025-06-05T16:13:04.628Z" },
{ url = "https://files.pythonhosted.org/packages/f6/f6/c82ac1851c60851302d8581680573245c8fc300253fc1ff741ae74a6c24d/greenlet-3.2.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:706d016a03e78df129f68c4c9b4c4f963f7d73534e48a24f5f5a7101ed13dbbb", size = 605461, upload-time = "2025-06-05T16:12:50.792Z" },
{ url = "https://files.pythonhosted.org/packages/98/82/d022cf25ca39cf1200650fc58c52af32c90f80479c25d1cbf57980ec3065/greenlet-3.2.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:419e60f80709510c343c57b4bb5a339d8767bf9aef9b8ce43f4f143240f88b7c", size = 1121190, upload-time = "2025-06-05T16:36:48.59Z" },
@@ -1059,7 +1058,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/b1/cf/f5c0b23309070ae93de75c90d29300751a5aacefc0a3ed1b1d8edb28f08b/greenlet-3.2.3-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:500b8689aa9dd1ab26872a34084503aeddefcb438e2e7317b89b11eaea1901ad", size = 270732, upload-time = "2025-06-05T16:10:08.26Z" },
{ url = "https://files.pythonhosted.org/packages/48/ae/91a957ba60482d3fecf9be49bc3948f341d706b52ddb9d83a70d42abd498/greenlet-3.2.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a07d3472c2a93117af3b0136f246b2833fdc0b542d4a9799ae5f41c28323faef", size = 639033, upload-time = "2025-06-05T16:38:53.983Z" },
{ url = "https://files.pythonhosted.org/packages/6f/df/20ffa66dd5a7a7beffa6451bdb7400d66251374ab40b99981478c69a67a8/greenlet-3.2.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:8704b3768d2f51150626962f4b9a9e4a17d2e37c8a8d9867bbd9fa4eb938d3b3", size = 652999, upload-time = "2025-06-05T16:41:37.89Z" },
- { url = "https://files.pythonhosted.org/packages/51/b4/ebb2c8cb41e521f1d72bf0465f2f9a2fd803f674a88db228887e6847077e/greenlet-3.2.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:5035d77a27b7c62db6cf41cf786cfe2242644a7a337a0e155c80960598baab95", size = 647368, upload-time = "2025-06-05T16:48:21.467Z" },
{ url = "https://files.pythonhosted.org/packages/8e/6a/1e1b5aa10dced4ae876a322155705257748108b7fd2e4fae3f2a091fe81a/greenlet-3.2.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2d8aa5423cd4a396792f6d4580f88bdc6efcb9205891c9d40d20f6e670992efb", size = 650037, upload-time = "2025-06-05T16:13:06.402Z" },
{ url = "https://files.pythonhosted.org/packages/26/f2/ad51331a157c7015c675702e2d5230c243695c788f8f75feba1af32b3617/greenlet-3.2.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2c724620a101f8170065d7dded3f962a2aea7a7dae133a009cada42847e04a7b", size = 608402, upload-time = "2025-06-05T16:12:51.91Z" },
{ url = "https://files.pythonhosted.org/packages/26/bc/862bd2083e6b3aff23300900a956f4ea9a4059de337f5c8734346b9b34fc/greenlet-3.2.3-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:873abe55f134c48e1f2a6f53f7d1419192a3d1a4e873bace00499a4e45ea6af0", size = 1119577, upload-time = "2025-06-05T16:36:49.787Z" },
@@ -1068,7 +1066,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/d8/ca/accd7aa5280eb92b70ed9e8f7fd79dc50a2c21d8c73b9a0856f5b564e222/greenlet-3.2.3-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:3d04332dddb10b4a211b68111dabaee2e1a073663d117dc10247b5b1642bac86", size = 271479, upload-time = "2025-06-05T16:10:47.525Z" },
{ url = "https://files.pythonhosted.org/packages/55/71/01ed9895d9eb49223280ecc98a557585edfa56b3d0e965b9fa9f7f06b6d9/greenlet-3.2.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8186162dffde068a465deab08fc72c767196895c39db26ab1c17c0b77a6d8b97", size = 683952, upload-time = "2025-06-05T16:38:55.125Z" },
{ url = "https://files.pythonhosted.org/packages/ea/61/638c4bdf460c3c678a0a1ef4c200f347dff80719597e53b5edb2fb27ab54/greenlet-3.2.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f4bfbaa6096b1b7a200024784217defedf46a07c2eee1a498e94a1b5f8ec5728", size = 696917, upload-time = "2025-06-05T16:41:38.959Z" },
- { url = "https://files.pythonhosted.org/packages/22/cc/0bd1a7eb759d1f3e3cc2d1bc0f0b487ad3cc9f34d74da4b80f226fde4ec3/greenlet-3.2.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:ed6cfa9200484d234d8394c70f5492f144b20d4533f69262d530a1a082f6ee9a", size = 692443, upload-time = "2025-06-05T16:48:23.113Z" },
{ url = "https://files.pythonhosted.org/packages/67/10/b2a4b63d3f08362662e89c103f7fe28894a51ae0bc890fabf37d1d780e52/greenlet-3.2.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:02b0df6f63cd15012bed5401b47829cfd2e97052dc89da3cfaf2c779124eb892", size = 692995, upload-time = "2025-06-05T16:13:07.972Z" },
{ url = "https://files.pythonhosted.org/packages/5a/c6/ad82f148a4e3ce9564056453a71529732baf5448ad53fc323e37efe34f66/greenlet-3.2.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:86c2d68e87107c1792e2e8d5399acec2487a4e993ab76c792408e59394d52141", size = 655320, upload-time = "2025-06-05T16:12:53.453Z" },
{ url = "https://files.pythonhosted.org/packages/5c/4f/aab73ecaa6b3086a4c89863d94cf26fa84cbff63f52ce9bc4342b3087a06/greenlet-3.2.3-cp314-cp314-win_amd64.whl", hash = "sha256:8c47aae8fbbfcf82cc13327ae802ba13c9c36753b67e760023fd116bc124a62a", size = 301236, upload-time = "2025-06-05T16:15:20.111Z" },