Skip to content

Commit aed862b

Browse files
author
Andrei Bratu
committed
better file resolution
1 parent 2193df7 commit aed862b

File tree

7 files changed

+206
-114
lines changed

7 files changed

+206
-114
lines changed

src/humanloop/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from humanloop.core.client_wrapper import SyncClientWrapper
1111

1212
from humanloop.evals import run_eval
13-
from humanloop.evals.types import Dataset, Evaluator, EvaluatorCheck, File
13+
from humanloop.evals.types import DatasetEvalConfig, EvaluatorEvalConfig, EvaluatorCheck, FileEvalConfig
1414

1515
from humanloop.base_client import AsyncBaseHumanloop, BaseHumanloop
1616
from humanloop.overload import overload_call, overload_log
@@ -42,10 +42,10 @@ def __init__(
4242

4343
def run(
4444
self,
45-
file: File,
45+
file: FileEvalConfig,
4646
name: Optional[str],
47-
dataset: Dataset,
48-
evaluators: Optional[Sequence[Evaluator]] = None,
47+
dataset: DatasetEvalConfig,
48+
evaluators: Optional[Sequence[EvaluatorEvalConfig]] = None,
4949
workers: int = 4,
5050
) -> List[EvaluatorCheck]:
5151
"""Evaluate your function for a given `Dataset` and set of `Evaluators`.

src/humanloop/decorators/flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from humanloop.evals.run import HumanloopRuntimeError
1616
from humanloop.types.chat_message import ChatMessage
1717
from humanloop.decorators.helpers import bind_args
18-
from humanloop.evals.types import File
18+
from humanloop.evals.types import FileEvalConfig
1919
from humanloop.otel.constants import (
2020
HUMANLOOP_FILE_TYPE_KEY,
2121
HUMANLOOP_LOG_KEY,
@@ -121,7 +121,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> Optional[R]:
121121
# Return the output of the decorated function
122122
return func_output # type: ignore [return-value]
123123

124-
wrapper.file = File( # type: ignore
124+
wrapper.file = FileEvalConfig( # type: ignore
125125
path=decorator_path,
126126
type=file_type, # type: ignore [arg-type, typeddict-item]
127127
version=FlowDict(**flow_kernel), # type: ignore

src/humanloop/decorators/prompt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Callable, TypeVar
66

77
from humanloop.context import DecoratorContext, set_decorator_context
8-
from humanloop.evals.types import File
8+
from humanloop.evals.types import FileEvalConfig
99

1010
logger = logging.getLogger("humanloop.sdk")
1111

@@ -30,7 +30,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
3030
output = func(*args, **kwargs)
3131
return output
3232

33-
wrapper.file = File( # type: ignore [attr-defined]
33+
wrapper.file = FileEvalConfig( # type: ignore [attr-defined]
3434
path=path,
3535
type="prompt",
3636
version={ # type: ignore [typeddict-item]

src/humanloop/decorators/tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from humanloop.context import get_evaluation_context, get_trace_id
1616
from humanloop.decorators.helpers import bind_args
17-
from humanloop.evals import File
17+
from humanloop.evals import FileEvalConfig
1818
from humanloop.evals.run import HumanloopRuntimeError
1919
from humanloop.otel.constants import (
2020
HUMANLOOP_FILE_KEY,
@@ -112,7 +112,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> Optional[R]:
112112
# Return the output of the decorated function
113113
return func_output
114114

115-
wrapper.file = File( # type: ignore
115+
wrapper.file = FileEvalConfig( # type: ignore
116116
path=path,
117117
type=file_type, # type: ignore [arg-type, typeddict-item]
118118
version=tool_kernel,

src/humanloop/evals/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .run import run_eval
2-
from .types import File
2+
from .types import FileEvalConfig
33

4-
__all__ = ["run_eval", "File"]
4+
__all__ = ["run_eval", "FileEvalConfig"]

0 commit comments

Comments
 (0)