Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Oct 11, 2024
1 parent 38d439f commit d3a09c3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/gen-ai/gen-ai-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The event name MUST be `gen_ai.system.message`.
| Body Field | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `role` | string | The actual role of the message author as passed in the message. | `"system"`, `"instructions"` | `Conditionally Required`: if available and not equal to `system` |
| `content` | `AnyValue` | The contents of the system message. | `"You're a friendly bot that answers questions about OpenTelemetry."` | `Opt-In` |
| `content` | `AnyValue` | The contents of the system message. | `"You're a helpful bot"` | `Opt-In` |

## User event

Expand All @@ -114,7 +114,7 @@ The event name MUST be `gen_ai.user.message`.
| Body Field | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `role` | string | The actual role of the message author as passed in the message. | `"user"`, `"customer"` | `Conditionally Required`: if available and if not equal to `user` |
| `content` | `AnyValue` | The contents of the user message. | `What telemetry is reported by OpenAI instrumentations?` | `Opt-In` |
| `content` | `AnyValue` | The contents of the user message. | `What's the weather in Paris` | `Opt-In` |

## Assistant event

Expand All @@ -125,23 +125,23 @@ The event name MUST be `gen_ai.assistant.message`.
| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) |
|--------------|--------------------------------|----------------------------------------|-------------------------------------------------|-------------------|
| `role` | string | The actual role of the message author as passed in the message. | `"assistant"`, `"bot"` | `Conditionally Required`: if available and if not equal to `assistant` |
| `content` | `AnyValue` | The contents of the assistant message. | `Spans, events, metrics defined by the GenAI semantic conventions.` | `Opt-In` |
| `tool_calls` | [ToolCall](#toolcall-object)[] | The tool calls generated by the model, such as function calls. | `[{"id":"call_mszuSIzqtI65i1wAUOE8w5H4", "function":{"name":"get_link_to_otel_semconv", "arguments":{"semconv":"gen_ai"}}, "type":"function"}]` | `Conditionally Required`: if available |
| `content` | `AnyValue` | The contents of the assistant message. | `The weather in Paris is rainy and overcast, with temperatures around 57°F` | `Opt-In` |
| `tool_calls` | [ToolCall](#toolcall-object)[] | The tool calls generated by the model, such as function calls. | `[{"id":"call_mszuSIzqtI65i1wAUOE8w5H4", "function":{"name":"get_weather", "arguments":{"location":"Paris"}}, "type":"function"}]` | `Conditionally Required`: if available |

### `ToolCall` object

| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) |
|------------|-----------------------------|------------------------------------|-------------------------------------------------|-------------------|
| `id` | string | The id of the tool call | `call_mszuSIzqtI65i1wAUOE8w5H4` | `Required` |
| `type` | string | The type of the tool | `function` | `Required` |
| `function` | [Function](#function-object)| The function that the model called | `{"name":"get_link_to_otel_semconv", "arguments":{"semconv":"gen_ai"}}` | `Required` |
| `function` | [Function](#function-object)| The function that the model called | `{"name":"get_weather", "arguments":{"location":"Paris"}}` | `Required` |

### `Function` object

| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) |
|-------------|------------|----------------------------------------|----------------------------|-------------------|
| `name` | string | The name of the function to call | `get_link_to_otel_semconv` | `Required` |
| `arguments` | `AnyValue` | The arguments to pass the the function | `{"semconv": "gen_ai"}` | `Opt-In` |
| `name` | string | The name of the function to call | `get_weather` | `Required` |
| `arguments` | `AnyValue` | The arguments to pass the the function | `{"location": "Paris"}` | `Opt-In` |

## Tool event

Expand All @@ -152,7 +152,7 @@ The event name MUST be `gen_ai.tool.message`.
| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) |
|----------------|--------|-----------------------------------------------|---------------------------------|-------------------|
| `role` | string | The actual role of the message author as passed in the message. | `"tool"`, `"function"` | `Conditionally Required`: if available and if not equal to `tool` |
| `content` | AnyValue | The contents of the tool message. | `opentelemetry.io` | `Opt-In` |
| `content` | AnyValue | The contents of the tool message. | `rainy, 57°F` | `Opt-In` |
| `id` | string | Tool call that this message is responding to. | `call_mszuSIzqtI65i1wAUOE8w5H4` | `Required` |

## Choice event
Expand All @@ -171,15 +171,15 @@ Choice event body has the following fields:
|-----------------|----------------------------|-------------------------------------------------|----------------------------------------|-------------------|
| `finish_reason` | string | The reason the model stopped generating tokens. | `stop`, `tool_calls`, `content_filter` | `Required` |
| `index` | int | The index of the choice in the list of choices. | `1` | `Required` |
| `message` | [Message](#message-object) | GenAI response message | `{"content":"The OpenAI semantic conventions are available at opentelemetry.io"}` | `Recommended` |
| `message` | [Message](#message-object) | GenAI response message | `{"content":"The weather in Paris is rainy and overcast, with temperatures around 57°F"}` | `Recommended` |

### `Message` object

| Body Field | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) |
|----------------|--------------------------------|-----------------------------------------------|---------------------------------|-------------------|
| `role` | string | The actual role of the message author as passed in the message. | `"assistant"`, `"bot"` | `Conditionally Required`: if available and if not equal to `assistant` |
| `content` | `AnyValue` | The contents of the assistant message. | `Spans, events, metrics defined by the GenAI semantic conventions.` | `Opt-In` |
| `tool_calls` | [ToolCall](#toolcall-object)[] | The tool calls generated by the model, such as function calls. | `[{"id":"call_mszuSIzqtI65i1wAUOE8w5H4", "function":{"name":"get_link_to_otel_semconv", "arguments":"{\"semconv\":\"gen_ai\"}"}, "type":"function"}]` | `Conditionally Required`: if available |
| `content` | `AnyValue` | The contents of the assistant message. | `The weather in Paris is rainy and overcast, with temperatures around 57°F` | `Opt-In` |
| `tool_calls` | [ToolCall](#toolcall-object)[] | The tool calls generated by the model, such as function calls. | `[{"id":"call_mszuSIzqtI65i1wAUOE8w5H4", "function":{"name":"get_weather", "arguments":{"location":"Paris"}}, "type":"function"}]` | `Conditionally Required`: if available |

## Custom events

Expand Down

0 comments on commit d3a09c3

Please sign in to comment.