This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
DSPy Logging Utilities | |
Author: Dhar Rawal | |
Works with DSPy to log forward calls and their results, using a custom handler function. | |
Works with typed predictors too! | |
""" | |
import functools | |
import json | |
from typing import Any, Callable, Dict, Optional, Tuple |