Skip to content

Commit 9c4705b

Browse files
authored
Merge pull request #1044 from parea-ai/feat-capture-metadata-llm-calls
fix: git not available
2 parents f783877 + 2bd1340 commit 9c4705b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

cookbook/openai/tracing_templated_llm_calls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
messages=[
1717
{"role": "user", "content": "Make up {{number}} people."},
1818
],
19-
template_inputs={"number": "three"},
19+
template_inputs={"number": "three"}, # with Parea wrapper, we can specify template_inputs which will appear as inputs and are used to fill-in the templated messages
20+
# metadata={"template_id": "make-up-people-v1"}, # via Parea wrapper, can associate request with any metadata
2021
)
2122
print(response.choices[0].message.content)

parea/wrapper/wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _init_trace(self, kwargs) -> Tuple[str, datetime, contextvars.Token]:
113113
trace_name=self.name,
114114
end_user_identifier=None,
115115
session_id=None,
116-
metadata=None,
116+
metadata=kwargs.pop("metadata", None),
117117
target=None,
118118
tags=None,
119119
inputs=template_inputs,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
66
[tool.poetry]
77
name = "parea-ai"
88
packages = [{ include = "parea" }]
9-
version = "0.2.197"
9+
version = "0.2.198"
1010
description = "Parea python sdk"
1111
readme = "README.md"
1212
authors = ["joel-parea-ai <[email protected]>"]

0 commit comments

Comments
 (0)