Skip to content

Commit d98a918

Browse files
authored
add traceid (#352)
* add traceid * update lint
1 parent 0f87d06 commit d98a918

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

erniebot/src/erniebot/backends/aistudio.py

+3
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,8 @@ def _add_aistudio_fields_to_headers(self, headers: HeadersType) -> HeadersType:
117117
"Key 'Authorization' already exists in `headers`: %r",
118118
headers["Authorization"],
119119
)
120+
if "EB_SDK_TRACE_APP_ID" in os.environ:
121+
headers["X-EB-SDK-TRACE-APP-ID"] = os.getenv("EB_SDK_TRACE_APP_ID", "")
122+
120123
headers["Authorization"] = f"token {self._access_token}"
121124
return headers

0 commit comments

Comments
 (0)