Skip to content

Commit aa2938e

Browse files
committed
feat: Added prompt and generation event names in track_llm_events
1 parent b4e8360 commit aa2938e

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.8.5] - 2025-03-28
11+
### Added
12+
- prompt_event_name and generation_event_name to track_llm_events
13+
1014
## [1.8.4] - 2025-03-17
1115
### Added
1216
- thread_id to track_llm_events

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "trubrics"
3-
version = "1.8.4"
3+
version = "1.8.5"
44
requires-python = ">=3.10"
55
license = { text = "Apache 2.0" }
66
authors = [

trubrics/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def track_llm(
115115
user_id: str,
116116
prompt: str,
117117
generation: str,
118+
prompt_event_name: str = "Prompt",
119+
generation_event_name: str = "Generation",
118120
assistant_id: str | None = None,
119121
properties: dict | None = None,
120122
timestamp: datetime | None = None,
@@ -127,6 +129,8 @@ def track_llm(
127129
user_id (str): The ID of the user.
128130
prompt (str): The prompt given to the LLM.
129131
generation (str): The generated response from the LLM.
132+
prompt_event_name (str): The name given to the prompt event in Trubrics.
133+
generation_event_name (str): The name given to the generation event in Trubrics.
130134
assistant_id (str | None): The ID of the assistant.
131135
properties (dict | None): Additional properties to track.
132136
timestamp (datetime | None): The timestamp of the generation event. If None, the current time in UTC is used.
@@ -138,6 +142,8 @@ def track_llm(
138142
"user_id": user_id,
139143
"prompt": prompt,
140144
"generation": generation,
145+
"prompt_event_name": prompt_event_name,
146+
"generation_event_name": generation_event_name,
141147
"assistant_id": assistant_id,
142148
"properties": properties,
143149
"timestamp": (

0 commit comments

Comments
 (0)