Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adjust llm.tools semantic convention example #1180

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions spec/semantic_conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The following attributes are reserved and MUST be supported by all OpenInference
| `llm.token_count.completion` | Integer | `15` | The number of tokens in the completion |
| `llm.token_count.prompt` | Integer | `5` | The number of tokens in the prompt |
| `llm.token_count.total` | Integer | `20` | Total number of tokens, including prompt and completion |
| `llm.tools` | List of objects<sup>†</sup> | `[{"tool": {"json_schema": "{}"}, ...]` | List of tools that are advertised to the LLM to be able to call |
| `llm.tools` | List of objects<sup>†</sup> | `[{"tool.name": "calculate", "tool.json_schema": "{}"}, ...]` | List of tools that are advertised to the LLM to be able to call |
| `message.content` | String | `"What's the weather today?"` | The content of a message in a chat |
| `message.contents` | List of objects<sup>†</sup> | `[{"message_content.type": "text", "message_content.text": "Hello"}, ...]` | The message contents to the llm, it is an array of `message_content` objects. |
| `message.function_call_arguments_json` | JSON String | `"{ 'x': 2 }"` | The arguments to the function call in JSON |
Expand Down Expand Up @@ -115,17 +115,17 @@ for i, obj in enumerate(messages):

```javascript
const messages = [
{ "message.role": "user", "message.content": "hello" },
{
"message.role": "assistant",
"message.content": "hi",
},
{ "message.role": "user", "message.content": "hello" },
{
"message.role": "assistant",
"message.content": "hi",
},
];

for (const [i, obj] of messages.entries()) {
for (const [key, value] of Object.entries(obj)) {
span.setAttribute(`input.messages.${i}.${key}`, value);
}
for (const [key, value] of Object.entries(obj)) {
span.setAttribute(`input.messages.${i}.${key}`, value);
}
}
```

Expand Down
Loading