Open
Description
Why do you need it?
- 开启流式响应后,ai-statistics 采集不到 input_token、output_token等值
Other related information
- 流式请求访问
attributes:
- apply_to_log: true
apply_to_span: true
key: model
value: model
value_source: response_body
- apply_to_log: true
apply_to_span: true
key: input_token
value: usage.prompt_tokens
value_source: response_body
- apply_to_log: true
apply_to_span: true
key: output_token
value: usage.completion_tokens
value_source: response_body
- apply_to_log: true
key: question
value: [email protected]
value_source: request_body
- apply_to_log: true
key: answer
rule: append
value: choices.0.delta.content
value_source: response_streaming_body
- apply_to_log: true
key: consumer
value: x-mse-consumer
value_source: request_header
Why do you need it?
- After turning on streaming response, ai-statistics cannot collect input_token, output_token and other values
Other related information
- Streaming request access
2. Non-streaming request access
attributes:
- apply_to_log: true
apply_to_span: true
key: model
value: model
value_source: response_body
- apply_to_log: true
apply_to_span: true
key: input_token
value: usage.prompt_tokens
value_source: response_body
- apply_to_log: true
apply_to_span: true
key: output_token
value: usage.completion_tokens
value_source: response_body
- apply_to_log: true
key: question
value: [email protected]
value_source: request_body
- apply_to_log: true
key: answer
rule: append
value: choices.0.delta.content
value_source: response_streaming_body
- apply_to_log: true
key: consumer
value: x-mse-consumer
value_source: request_header
Metadata
Metadata
Assignees
Labels
No labels