Skip to content

Commit

Permalink
fix: prompt/completion format
Browse files Browse the repository at this point in the history
  • Loading branch information
nirga committed Mar 20, 2024
1 parent 902ac95 commit 5c6df3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/ai/llm-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The event name MUST be `gen_ai.llm.content.prompt`.

| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`gen_ai.llm.prompt`](../attributes-registry/llm.md) | string | The full prompt string sent to an LLM in a request. [1] | `\\n\\nHuman:You are an AI assistant that tells jokes. Can you tell me a joke about OpenTelemetry?\\n\\nAssistant:` | Recommended |
| [`gen_ai.llm.prompt`](../attributes-registry/llm.md) | string | The full prompt sent to an LLM, as a stringified JSON in OpenAI's format. [1] | `[{'role': 'user', 'content': 'What is the capital of France?'}]` | Recommended |

**[1]:** The full prompt sent to an LLM in a request, structured as a JSON in OpenAI's format.
<!-- endsemconv -->
Expand All @@ -75,7 +75,7 @@ The event name MUST be `gen_ai.llm.content.completion`.

| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`gen_ai.llm.completion`](../attributes-registry/llm.md) | string | The full response string from an LLM in a response. [1] | `Why did the developer stop using OpenTelemetry? Because they couldnt trace their steps!` | Recommended |
| [`gen_ai.llm.completion`](../attributes-registry/llm.md) | string | The full response received from the LLM, as a stringified JSON in OpenAI's format. [1] | `[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]` | Recommended |

**[1]:** The full response from an LLM, structured as a JSON in OpenAI's format.
<!-- endsemconv -->
Expand Down
8 changes: 2 additions & 6 deletions docs/attributes-registry/llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* [Request Attributes](#request-attributes)
* [Response Attributes](#response-attributes)
* [Event Attributes](#event-attributes)
- [OpenAI Attributes](#openai-attributes)
* [Request Attributes](#request-attributes-1)
* [Response Attributes](#response-attributes-1)
* [Event Attributes](#event-attributes-1)

<!-- tocstop -->

Expand Down Expand Up @@ -47,6 +43,6 @@
<!-- semconv registry.llm(omit_requirement_level,tag=llm-generic-events) -->
| Attribute | Type | Description | Examples |
|---|---|---|---|
| `gen_ai.llm.completion` | string | The full response string from an LLM in a response. | `Why did the developer stop using OpenTelemetry? Because they couldnt trace their steps!` |
| `gen_ai.llm.prompt` | string | The full prompt string sent to an LLM in a request. | `\\n\\nHuman:You are an AI assistant that tells jokes. Can you tell me a joke about OpenTelemetry?\\n\\nAssistant:` |
| `gen_ai.llm.completion` | string | The full response received from the LLM, as a stringified JSON in OpenAI's format. | `[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]` |
| `gen_ai.llm.prompt` | string | The full prompt sent to an LLM, as a stringified JSON in OpenAI's format. | `[{'role': 'user', 'content': 'What is the capital of France?'}]` |
<!-- endsemconv -->
8 changes: 4 additions & 4 deletions model/registry/llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ groups:
tag: llm-generic-response
- id: prompt
type: string
brief: The full prompt string sent to an LLM in a request.
examples: ['\\n\\nHuman:You are an AI assistant that tells jokes. Can you tell me a joke about OpenTelemetry?\\n\\nAssistant:']
brief: The full prompt sent to an LLM, as a stringified JSON in OpenAI's format.
examples: ["[{'role': 'user', 'content': 'What is the capital of France?'}]"]
tag: llm-generic-events
- id: completion
type: string
brief: The full response string from an LLM in a response.
examples: ['Why did the developer stop using OpenTelemetry? Because they couldnt trace their steps!']
brief: The full response received from the LLM, as a stringified JSON in OpenAI's format.

Check failure on line 65 in model/registry/llm.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[colons] too many spaces after colon
examples: ["[{'role': 'assistant', 'content': 'The capital of France is Paris.'}]"]
tag: llm-generic-events

0 comments on commit 5c6df3e

Please sign in to comment.