Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ __pycache__/
poetry.toml
.ruff_cache/
.vscode
.env
.env
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[project]
name = "humanloop"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary, aka why was it added now?


[tool.poetry]
name = "humanloop"
version = "0.8.22"
Expand Down
9 changes: 4 additions & 5 deletions src/humanloop/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
from opentelemetry.trace import Tracer

from humanloop.core.client_wrapper import SyncClientWrapper
from humanloop.decorators.types import DecoratorPromptKernelRequestParams
from humanloop.utilities.types import DecoratorPromptKernelRequestParams
from humanloop.eval_utils.context import EVALUATION_CONTEXT_VARIABLE_NAME, EvaluationContext

from humanloop.eval_utils import log_with_evaluation_context, run_eval
from humanloop.eval_utils.types import Dataset, Evaluator, EvaluatorCheck, File

from humanloop.base_client import AsyncBaseHumanloop, BaseHumanloop
from humanloop.decorators.flow import flow as flow_decorator_factory
from humanloop.decorators.prompt import prompt as prompt_decorator_factory
from humanloop.decorators.tool import tool as tool_decorator_factory
from humanloop.utilities.flow import flow as flow_decorator_factory
from humanloop.utilities.prompt import prompt as prompt_decorator_factory
from humanloop.utilities.tool import tool as tool_decorator_factory
from humanloop.environment import HumanloopEnvironment
from humanloop.evaluations.client import EvaluationsClient
from humanloop.otel import instrument_provider
Expand Down Expand Up @@ -49,7 +49,6 @@ def run(
name: Optional[str],
dataset: Dataset,
evaluators: Optional[Sequence[Evaluator]] = None,
# logs: typing.Sequence[dict] | None = None,
workers: int = 4,
) -> List[EvaluatorCheck]:
"""Evaluate your function for a given `Dataset` and set of `Evaluators`.
Expand Down
5 changes: 0 additions & 5 deletions src/humanloop/eval_utils/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ def increment(self):
sys.stderr.write("\n")


# Module-level so it can be shared by threads.
_PROGRESS_BAR: Optional[_SimpleProgressBar] = None


def run_eval(
client: "BaseHumanloop",
file: File,
Expand All @@ -236,7 +232,6 @@ def run_eval(
:param workers: the number of threads to process datapoints using your function concurrently.
:return: per Evaluator checks.
"""
global _PROGRESS_BAR

if hasattr(file["callable"], "file"):
# When the decorator inside `file` is a decorated function,
Expand Down
12 changes: 0 additions & 12 deletions src/humanloop/otel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from typing import Optional, TypedDict

from opentelemetry.sdk.trace import TracerProvider
from typing_extensions import NotRequired

from humanloop.otel.helpers import module_is_installed

Expand Down Expand Up @@ -41,12 +38,3 @@ def instrument_provider(provider: TracerProvider):
from opentelemetry.instrumentation.bedrock import BedrockInstrumentor

BedrockInstrumentor().instrument(tracer_provider=provider)


class FlowContext(TypedDict):
trace_id: NotRequired[str]
trace_parent_id: NotRequired[Optional[int]]
is_flow_log: NotRequired[bool]


TRACE_FLOW_CONTEXT: dict[int, FlowContext] = {}
2 changes: 2 additions & 0 deletions src/humanloop/otel/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
HUMANLOOP_LOG_KEY = "humanloop.log"
HUMANLOOP_FILE_TYPE_KEY = "humanloop.file.type"
HUMANLOOP_PATH_KEY = "humanloop.file.path"
# Required for the exporter to know when to mark the Flow Log as complete
HUMANLOOP_FLOW_PREREQUISITES_KEY = "humanloop.flow.prerequisites"
Loading