Skip to content

Commit 11a64b9

Browse files
author
Andrei Bratu
committed
QA bugfixing
1 parent 50836e7 commit 11a64b9

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/humanloop/decorators/flow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import traceback
23
import uuid
34
from functools import wraps
45
from typing import Any, Callable, Mapping, Optional, Sequence
@@ -67,7 +68,8 @@ def wrapper(*args: Sequence[Any], **kwargs: Mapping[str, Any]) -> Any:
6768
output = func(*args, **kwargs)
6869
error = None
6970
except Exception as e:
70-
logger.error(f"{func.__name__}: {e}")
71+
# print error, line of code, and function name
72+
logger.error(f"Error calling {func.__name__}: {e}")
7173
output = None
7274
error = str(e)
7375

src/humanloop/decorators/prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def wrapper(*args: Sequence[Any], **kwargs: Mapping[str, Any]) -> Any:
112112
output = func(*args, **kwargs)
113113
error = None
114114
except Exception as e:
115-
logger.error(f"{func.__name__}: {e}")
115+
logger.error(f"Error calling {func.__name__}: {e}")
116116
output = None
117117
error = str(e)
118118

src/humanloop/decorators/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def wrapper(*args, **kwargs):
7171
output = func(*args, **kwargs)
7272
error = None
7373
except Exception as e:
74-
logger.error(f"{func.__name__}: {e}")
74+
logger.error(f"Error calling {func.__name__}: {e}")
7575
output = None
7676
error = str(e)
7777

src/humanloop/otel/exporter.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class HumanloopSpanExporter(SpanExporter):
3131
Spans not created by Humanloop SDK decorators will be ignored.
3232
"""
3333

34-
DEFAULT_NUMBER_THREADS = 1
34+
DEFAULT_NUMBER_THREADS = 4
3535

3636
def __init__(
3737
self,
@@ -257,10 +257,8 @@ def _export_flow(self, span: ReadableSpan) -> None:
257257
else:
258258
flow = file_object["flow"]
259259
path: str = file_object["path"]
260-
if not isinstance(log_object["output"], str):
261-
# Output expected to be a string, if decorated function
262-
# does not return one, jsonify it
263-
log_object["output"] = json.dumps(log_object["output"])
260+
if "output" not in log_object:
261+
log_object["output"] = None
264262
try:
265263
log_response = self._client.flows.log(
266264
path=path,

src/humanloop/otel/processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _enrich_prompt_kernel(prompt_span: ReadableSpan, llm_provider_call_span: Rea
125125
prompt["max_tokens"] = prompt.get("max_tokens") or gen_ai_object.get("request", {}).get("max_tokens", None)
126126
prompt["presence_penalty"] = prompt.get("presence_penalty") or llm_object.get("presence_penalty", None)
127127
prompt["frequency_penalty"] = prompt.get("frequency_penalty") or llm_object.get("frequency_penalty", None)
128-
prompt["tools"] = list(prompt.get("tools", {}).values())
128+
prompt["tools"] = prompt.get("tools", [])
129129

130130
try:
131131
# Validate the Prompt Kernel

0 commit comments

Comments
 (0)