Skip to content

Commit 87c317b

Browse files
committed
more flow decorators
1 parent fe4e458 commit 87c317b

22 files changed

+891
-127
lines changed

.github/workflows/ci.yml

-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ jobs:
4343
run: poetry run pytest -rP .
4444
env:
4545
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
46-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
47-
REPLICATE_API_KEY: ${{ secrets.REPLICATE_API_KEY }}
48-
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
49-
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
5046
HUMANLOOP_API_KEY: ${{ secrets.HUMANLOOP_API_KEY }}
5147

5248
publish:

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "humanloop"
33

44
[tool.poetry]
55
name = "humanloop"
6-
version = "0.8.36"
6+
version = "0.8.36b1"
77
description = ""
88
readme = "README.md"
99
authors = []

src/humanloop/client.py

+5-7
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`.
@@ -144,9 +144,7 @@ def __init__(
144144
)
145145

146146
if opentelemetry_tracer is None:
147-
self._opentelemetry_tracer = self._tracer_provider.get_tracer(
148-
"humanloop.sdk"
149-
)
147+
self._opentelemetry_tracer = self._tracer_provider.get_tracer("humanloop.sdk")
150148
else:
151149
self._opentelemetry_tracer = opentelemetry_tracer
152150

src/humanloop/core/client_wrapper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def __init__(self, *, api_key: str, base_url: str, timeout: typing.Optional[floa
1414

1515
def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
17-
"User-Agent": "humanloop/0.8.36",
17+
"User-Agent": "humanloop/0.8.36b1",
1818
"X-Fern-Language": "Python",
1919
"X-Fern-SDK-Name": "humanloop",
20-
"X-Fern-SDK-Version": "0.8.36",
20+
"X-Fern-SDK-Version": "0.8.36b1",
2121
}
2222
headers["X-API-KEY"] = self.api_key
2323
return headers

src/humanloop/decorators/flow.py

+2-2
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

+2-2
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

+2-2
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

+2-2
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)