Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

LLMEvent.model can take MODEL enum or string

Howard Gil88b18b0c0dee
diff --git a/agentops/event.py b/agentops/event.py
index 98ce259d..02102b49 100644
--- a/agentops/event.py
+++ b/agentops/event.py
@@ -51,7 +51,7 @@ class LLMEvent(Event):
completion_message_format: LLMMessageFormat = LLMMessageFormat.STRING # TODO: remove from serialization
# TODO: remove and just create it in __post_init__ so it can never be set by user?
_formatted_completion_message: object = field(init=False, default=None)
- model: Optional[Models] = None
+ model: Optional[Models | str] = None
prompt_tokens: Optional[int] = None
completion_tokens: Optional[int] = None