Skip to content

Commit ece10bd

Browse files
committed
fix: template variables should be JSON string
1 parent 32d09ca commit ece10bd

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

trace/spec/semantic_conventions.md

+46-46
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,50 @@ The **Semantic Conventions** define the keys and values which describe commonly
66

77
The following attributes are reserved and MUST be supported by all OpenInference Tracing SDKs:
88

9-
| Attribute | Type | Example | Description |
10-
| -------------------------------------- | --------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------- |
11-
| `exception.type` | String | `"NullPointerException"` | The type of exception that was thrown |
12-
| `exception.message` | String | `"Null value encountered"` | Detailed message describing the exception |
13-
| `exception.escaped` | Boolean | `true` | Indicator if the exception has escaped the span's scope |
14-
| `exception.stacktrace` | String | `"at app.main(app.java:16)"` | The stack trace of the exception |
15-
| `output.value` | String | `"Hello, World!"` | The output value of an operation |
16-
| `output.mime_type` | String | `"text/plain"` or `"application/json"` | MIME type representing the format of `output.value` |
17-
| `input.value` | String | `"{'query': 'What is the weather today?'}"` | The input value to an operation |
18-
| `input.mime_type` | String | `"text/plain"` or `"application/json"` | MIME type representing the format of `input.value` |
19-
| `embedding.embeddings` | List of objects | `[{"embeeding.vector": [...], "embedding.text": "hello"}]` | List of embedding objects including text and vector data |
20-
| `embedding.model_name` | String | `"BERT-base"` | Name of the embedding model used |
21-
| `embedding.text` | String | `"hello world"` | The text represented in the embedding |
22-
| `embedding.vector` | List of floats | `[0.123, 0.456, ...]` | The embedding vector consisting of a list of floats |
23-
| `llm.function_call` | JSON String | `"{function_name: 'add', args: [1, 2]}"` | Object recording details of a function call in models or APIs |
24-
| `llm.invocation_parameters` | JSON string | `"{model_name: 'gpt-3', temperature: 0.7}"` | Parameters used during the invocation of an LLM or API |
25-
| `llm.input_messages` | List of objects | `[{"message.role": "user", "message.content": "hello"}]` | List of messages sent to the LLM in a chat API request |
26-
| `llm.output_messages` | List of objects | `[{"message.role": "user", "message.content": "hello"}]` | List of messages received from the LLM in a chat API request |
27-
| `message.role` | String | `"user"` or `"system"` | Role of the entity in a message (e.g., user, system) |
28-
| `message.function_call_name` | String | `"multiply"` or `"subtract"` | Function call function name |
29-
| `message.function_call_arguments_json` | JSON String | `"{ 'x': 2 }"` | The arguments to the function call in JSON |
30-
| `message.content` | String | `"What's the weather today?"` | The content of a message in a chat |
31-
| `message.tool_calls` | List of objects | `[{"tool_call.function.name": "get_current_weather"}]` | List of tool calls (e.g. function calls) generated by the LLM |
32-
| `tool_call.function.name` | String | `get_current_weather` | The name of the function being invoked by a tool call |
33-
| `tool_call.function.arguments` | JSON string | `"{'city': 'London'}"` | The arguments for the function being invoked by a tool call |
34-
| `llm.model_name` | String | `"gpt-3.5-turbo"` | The name of the language model being utilized |
35-
| `llm.prompt_template.template` | String | `"Weather forecast for {city} on {date}"` | Template used to generate prompts as Python f-strings |
36-
| `llm.prompt_template.variables` | List of strings | `["city", "date"]` | List of variables to be used in the prompt template |
37-
| `llm.prompt_template.version` | String | `"v1.0"` | The version of the prompt template |
38-
| `llm.token_count.prompt` | Integer | `5` | The number of tokens in the prompt |
39-
| `llm.token_count.completion` | Integer | `15` | The number of tokens in the completion |
40-
| `llm.token_count.total` | Integer | `20` | Total number of tokens, including prompt and completion |
41-
| `tool.name` | String | `"WeatherAPI"` | The name of the tool being utilized |
42-
| `tool.description` | String | `"An API to get weather data."` | Description of the tool's purpose and functionality |
43-
| `tool.parameters` | JSON string | `"{ 'a': 'int' }"` | The parameters definition for invoking the tool |
44-
| `retrieval.documents` | List of objects | `[{"document.id": "1", "document.score": 0.9, "document.content": "..."}]` | List of retrieved documents |
45-
| `document.id` | String/Integer | `"1234"` or `1` | Unique identifier for a document |
46-
| `document.score` | Float | `0.98` | Score representing the relevance of a document |
47-
| `document.content` | String | `"This is a sample document content."` | The content of a retrieved document |
48-
| `document.metadata` | Object | `{"author": "John Doe", "date": "2023-09-09"}` | Metadata associated with a document |
49-
| `reranker.input_documents` | List of objects | `[{"document.id": "1", "document.score": 0.9, "document.content": "..."}]` | List of documents as input to the reranker |
50-
| `reranker.output_documents` | List of objects | `[{"document.id": "1", "document.score": 0.9, "document.content": "..."}]` | List of documents outputted by the reranker |
51-
| `reranker.query` | String | `"How to format timestamp?"` | Query parameter of the reranker |
52-
| `reranker.model_name` | String | `"cross-encoder/ms-marco-MiniLM-L-12-v2"` | Model name of the reranker |
53-
| `reranker.top_k` | Integer | 3 | Top K parameter of the reranker |
9+
| Attribute | Type | Example | Description |
10+
| -------------------------------------- | --------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------- |
11+
| `exception.type` | String | `"NullPointerException"` | The type of exception that was thrown |
12+
| `exception.message` | String | `"Null value encountered"` | Detailed message describing the exception |
13+
| `exception.escaped` | Boolean | `true` | Indicator if the exception has escaped the span's scope |
14+
| `exception.stacktrace` | String | `"at app.main(app.java:16)"` | The stack trace of the exception |
15+
| `output.value` | String | `"Hello, World!"` | The output value of an operation |
16+
| `output.mime_type` | String | `"text/plain"` or `"application/json"` | MIME type representing the format of `output.value` |
17+
| `input.value` | String | `"{'query': 'What is the weather today?'}"` | The input value to an operation |
18+
| `input.mime_type` | String | `"text/plain"` or `"application/json"` | MIME type representing the format of `input.value` |
19+
| `embedding.embeddings` | List of objects | `[{"embeeding.vector": [...], "embedding.text": "hello"}]` | List of embedding objects including text and vector data |
20+
| `embedding.model_name` | String | `"BERT-base"` | Name of the embedding model used |
21+
| `embedding.text` | String | `"hello world"` | The text represented in the embedding |
22+
| `embedding.vector` | List of floats | `[0.123, 0.456, ...]` | The embedding vector consisting of a list of floats |
23+
| `llm.function_call` | JSON String | `"{function_name: 'add', args: [1, 2]}"` | Object recording details of a function call in models or APIs |
24+
| `llm.invocation_parameters` | JSON string | `"{model_name: 'gpt-3', temperature: 0.7}"` | Parameters used during the invocation of an LLM or API |
25+
| `llm.input_messages` | List of objects | `[{"message.role": "user", "message.content": "hello"}]` | List of messages sent to the LLM in a chat API request |
26+
| `llm.output_messages` | List of objects | `[{"message.role": "user", "message.content": "hello"}]` | List of messages received from the LLM in a chat API request |
27+
| `message.role` | String | `"user"` or `"system"` | Role of the entity in a message (e.g., user, system) |
28+
| `message.function_call_name` | String | `"multiply"` or `"subtract"` | Function call function name |
29+
| `message.function_call_arguments_json` | JSON String | `"{ 'x': 2 }"` | The arguments to the function call in JSON |
30+
| `message.content` | String | `"What's the weather today?"` | The content of a message in a chat |
31+
| `message.tool_calls` | List of objects | `[{"tool_call.function.name": "get_current_weather"}]` | List of tool calls (e.g. function calls) generated by the LLM |
32+
| `tool_call.function.name` | String | `get_current_weather` | The name of the function being invoked by a tool call |
33+
| `tool_call.function.arguments` | JSON string | `"{'city': 'London'}"` | The arguments for the function being invoked by a tool call |
34+
| `llm.model_name` | String | `"gpt-3.5-turbo"` | The name of the language model being utilized |
35+
| `llm.prompt_template.template` | String | `"Weather forecast for {city} on {date}"` | Template used to generate prompts as Python f-strings |
36+
| `llm.prompt_template.variables` | JSON String | `{ context: "<context from retrieval>", subject: "math" }` | JSON of key value pairs applied to the prompt template |
37+
| `llm.prompt_template.version` | String | `"v1.0"` | The version of the prompt template |
38+
| `llm.token_count.prompt` | Integer | `5` | The number of tokens in the prompt |
39+
| `llm.token_count.completion` | Integer | `15` | The number of tokens in the completion |
40+
| `llm.token_count.total` | Integer | `20` | Total number of tokens, including prompt and completion |
41+
| `tool.name` | String | `"WeatherAPI"` | The name of the tool being utilized |
42+
| `tool.description` | String | `"An API to get weather data."` | Description of the tool's purpose and functionality |
43+
| `tool.parameters` | JSON string | `"{ 'a': 'int' }"` | The parameters definition for invoking the tool |
44+
| `retrieval.documents` | List of objects | `[{"document.id": "1", "document.score": 0.9, "document.content": "..."}]` | List of retrieved documents |
45+
| `document.id` | String/Integer | `"1234"` or `1` | Unique identifier for a document |
46+
| `document.score` | Float | `0.98` | Score representing the relevance of a document |
47+
| `document.content` | String | `"This is a sample document content."` | The content of a retrieved document |
48+
| `document.metadata` | Object | `{"author": "John Doe", "date": "2023-09-09"}` | Metadata associated with a document |
49+
| `reranker.input_documents` | List of objects | `[{"document.id": "1", "document.score": 0.9, "document.content": "..."}]` | List of documents as input to the reranker |
50+
| `reranker.output_documents` | List of objects | `[{"document.id": "1", "document.score": 0.9, "document.content": "..."}]` | List of documents outputted by the reranker |
51+
| `reranker.query` | String | `"How to format timestamp?"` | Query parameter of the reranker |
52+
| `reranker.model_name` | String | `"cross-encoder/ms-marco-MiniLM-L-12-v2"` | Model name of the reranker |
53+
| `reranker.top_k` | Integer | 3 | Top K parameter of the reranker |
5454

55-
Note: the `object` type refers to a set of key-value pairs also known as a `struct`, `mapping`, `dictionary`, etc.
55+
Note: the `object` type refers to a set of key-value pairs also known as a `struct`, `mapping`, `dictionary`, etc.

0 commit comments

Comments
 (0)