mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-16 22:57:53 +08:00
- Start TTFT timing before invoking direct plugin executors in both non-streaming and streaming handler paths. - Record first-packet arrival for non-streaming responses and observe protocol-aware stream chunk TTFT events before publishing usage. Closes: #7253
19 lines
671 B
Go
19 lines
671 B
Go
package handlers
|
|
|
|
import (
|
|
"github.com/router-for-me/CLIProxyAPI/v8/internal/runtime/executor/helps"
|
|
"github.com/router-for-me/CLIProxyAPI/v8/sdk/cliproxy/usage"
|
|
)
|
|
|
|
func parsePluginExecutorResponseUsage(protocol string, payload []byte) usage.Detail {
|
|
return helps.ParsePluginExecutorResponseUsage(protocol, payload)
|
|
}
|
|
|
|
func observePluginExecutorStreamUsage(protocol string, payload []byte, buffer *helps.StreamUsageBuffer) {
|
|
helps.ObservePluginExecutorStreamUsage(protocol, payload, buffer)
|
|
}
|
|
|
|
func observePluginExecutorStreamTTFT(protocol string, reporter *helps.UsageReporter, payload []byte) {
|
|
helps.ObservePluginExecutorStreamTTFT(protocol, reporter, payload)
|
|
}
|