Package com.alibaba.dashscope.transport
Class UserAgentInterceptor
java.lang.Object
com.alibaba.dashscope.transport.UserAgentInterceptor
- All Implemented Interfaces:
okhttp3.Interceptor
Attaches SDK telemetry headers (design §6): User-Agent (version), x-dashscope-sdk-session-id
(shared with 2.x via the neutral layer, so one process reports one session id across
generations), and x-dashscope-sdk-client in the
client/version/module form. The module
segment names the functional area issuing the request (aigc / embeddings / audio / ...) and
carries a trailing MODULE_MARKER so the 3.0 surface stays separable from 2.x: one
artifact ships both the legacy_2x transport and this 3.0 transport and both read the same SdkInfo.VERSION, so the version segment alone cannot tell them apart. With the marker 3.0 emits
aigc3 while 2.x stays aigc, mirroring the Python SDK's V2_MODULE_MARKER. The two
tracking headers honor the 2.x DASHSCOPE_DISABLE_SDK_HEADERS opt-out (1/true); User-Agent
itself is not a tracking header and stays.-
Nested Class Summary
Nested classes/interfaces inherited from interface okhttp3.Interceptor
okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion -
Field Summary
FieldsFields inherited from interface okhttp3.Interceptor
Companion -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
HEADER_SDK_CLIENT
- See Also:
-
HEADER_SDK_SESSION_ID
- See Also:
-
-
Constructor Details
-
UserAgentInterceptor
public UserAgentInterceptor()
-
-
Method Details
-
intercept
- Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
IOException
-