From 08fbce6c8d6da51da6cfe2ec119b0e6d4e6bf38d Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Tue, 2 Jan 2024 11:36:16 -0700 Subject: [PATCH] move messages attributes --- .../openinference/semconv/trace/__init__.py | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/python/openinference-semantic-conventions/src/openinference/semconv/trace/__init__.py b/python/openinference-semantic-conventions/src/openinference/semconv/trace/__init__.py index 8208c8c4d..391e36c82 100644 --- a/python/openinference-semantic-conventions/src/openinference/semconv/trace/__init__.py +++ b/python/openinference-semantic-conventions/src/openinference/semconv/trace/__init__.py @@ -30,19 +30,6 @@ class SpanAttributes: The embedding vector. """ - MESSAGE_ROLE = "message.role" - """ - The role of the message, such as "user", "agent", "function". - """ - MESSAGE_NAME = "message.name" - """ - The name of the message, often used to identify the function - that was used to generate the message. - """ - MESSAGE_TOOL_CALLS = "message.tool_calls" - """ - The tool calls generated by the model, such as function calls. - """ TOOL_CALL_FUNCTION_NAME = "tool_call.function.name" """ The name of function that is being called during a tool call. @@ -161,3 +148,22 @@ class SpanAttributes: """ OPENINFERENCE_SPAN_KIND = "openinference.span.kind" + +class MessageAttributes: + """ + Attributes for a message generated by a LLM + """ + + MESSAGE_ROLE = "message.role" + """ + The role of the message, such as "user", "agent", "function". + """ + MESSAGE_NAME = "message.name" + """ + The name of the message, often used to identify the function + that was used to generate the message. + """ + MESSAGE_TOOL_CALLS = "message.tool_calls" + """ + The tool calls generated by the model, such as function calls. + """ \ No newline at end of file