LLM 应用语义规范正在不断演进当中,探针版本在新版本发布时,各种 LLM 插件会逐渐向最新版本的语义规范靠拢。本文档用于记录在新版本探针发布时,语义规范发生的变化。
Python 探针
2.0.0 版本
升级到 2.0.0 版本后,请同步更新引用了下文所列已重命名或已移除属性的仪表盘或告警。
Span Attributes
所属组件 | 调用类型 | 原 Attribute | 新 Attribute | 备注 |
OpenAI | LLM | gen_ai.prompts | gen_ai.input.messages | 从平铺的属性记录方式替换为 JSON 格式,详情参见控制 LLM 应用对话历史采集行为。 |
gen_ai.completions | gen_ai.output.messages | 从平铺的属性记录方式替换为 JSON 格式,详情参见控制 LLM 应用对话历史采集行为。 | ||
gen_ai.model_name | 移除 | - | ||
gen_ai.request.model_name | gen_ai.request.model | - | ||
gen_ai.response.model_name | gen_ai.response.model | - | ||
input.mime_type | 移除 | - | ||
input.value | gen_ai.input.messages | 从非结构化记录方式替换为 JSON 格式,详情参见控制 LLM 应用对话历史采集行为。 | ||
output.mime_type | gen_ai.output.type | - | ||
output.value | gen_ai.output.messages | 从非结构化记录方式替换为 JSON 格式,详情参见控制 LLM 应用对话历史采集行为。 | ||
gen_ai.request.tool_calls | gen_ai.tool.definitions | 从非结构化记录方式替换为 JSON 格式,详情参见控制 LLM 应用对话历史采集行为。 | ||
新增 | gen_ai.request.choice.count | - | ||
新增 | gen_ai.request.seed | - | ||
新增 | gen_ai.request.frequency_penalty | - | ||
新增 | gen_ai.request.presence_penalty | - | ||
新增 | gen_ai.request.max_tokens | - | ||
新增 | gen_ai.request.top_p | - | ||
新增 | gen_ai.request.top_k | - | ||
新增 | gen_ai.request.stop_sequences | - | ||
新增 | gen_ai.response.id | - | ||
新增 | gen_ai.response.finish_reasons | - | ||
gen_ai.usage.prompt_tokens | gen_ai.usage.input_tokens | - | ||
gen_ai.usage.completion_tokens | gen_ai.usage.output_tokens | - | ||
Embedding | embedding.model_name | gen_ai.request.model | - | |
embedding.text | 移除 | - | ||
embedding.vector | 移除 | - | ||
embedding.vector_size | gen_ai.embeddings.dimension.count | - | ||
新增 | gen_ai.encoding.formats | - |
输入输出格式变更
2.0.0 版本中,部分属性由平铺字符串或非结构化格式变更为结构化的 JSON 数组。新旧格式示例如下。
gen_ai.prompts(旧)与 gen_ai.input.messages(新)
旧格式(平铺字符串):
"You are a helpful assistant.\nWhat is cloud computing?"新格式(JSON 数组):
[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is cloud computing?"}
]gen_ai.completions(旧)与 gen_ai.output.messages(新)
旧格式(平铺字符串):
"Cloud computing is the on-demand delivery of IT resources over the Internet."新格式(JSON 数组):
[
{"role": "assistant", "content": "Cloud computing is the on-demand delivery of IT resources over the Internet."}
]