Skip to content

Commit

Permalink
Adding anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermp committed Sep 14, 2023
1 parent ebcab1e commit bdda45a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
36 changes: 35 additions & 1 deletion docs/ai/anthropic.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
todo
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: Anthropic
--->

# Semantic Conventions for Anthropic

**Status**: [Experimental][DocumentStatus]

The Semantic Conventions for [Anthropic](https://docs.anthropic.com/claude/docs) extend the [LLM Semantic Conventions](llm-spans.md)
that describe common LLM request attributes in addition to the Semantic Conventions
described on this page.

## Anthropic LLM request attributes

These are additional attributes when instrumenting Anthropic LLM requests.

<!-- semconv llm.anthropic(tag=llm-request-tech-specific) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `llm.anthropic.top_k` | int | If present, represents the value used to only sample from the top K options for each subsequent token. | `5` | Required |
| `llm.anthropic.metadata.user_id` | string | If present, the `user_id` used in an Anthropic request. | `bob` | Required |

## Anthropic LLM response attributes

These are additional attributes when instrumenting Anthropic LLM responses.

### Chat completion attributes

These are the attributes for a full chat completion (no streaming).

<!-- semconv llm.anthropic(tag=llm-response-tech-specific) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `llm.anthropic.stop_reason` | string | The reason why the model stopped sampling. | `stop_sequence` | Required |
| `llm.ahtropic.model` | string | The name of the model used for the completion. | `claude-instant-1` | Recommended |
2 changes: 1 addition & 1 deletion docs/ai/openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ linkTitle: OpenAI

**Status**: [Experimental][DocumentStatus]

The Semantic Conventions for [OpenAI](https://www.microsoft.com/sql-server) extend the [LLM Semantic Conventions](llm-spans.md)
The Semantic Conventions for [OpenAI](https://platform.openai.com/) extend the [LLM Semantic Conventions](llm-spans.md)
that describe common LLM request attributes in addition to the Semantic Conventions
described on this page.

Expand Down

0 comments on commit bdda45a

Please sign in to comment.