Skip to content

Commit 64ebf36

Browse files
committed
Add deployed ADK agent user agent
1 parent 1da4a91 commit 64ebf36

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/gradient/_base_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import os
34
import sys
45
import json
56
import time
@@ -678,7 +679,12 @@ def user_agent(self) -> str:
678679
# Format: "Gradient/package/version"
679680
package = self._user_agent_package or "Python"
680681
version = self._user_agent_version if self._user_agent_package and self._user_agent_version else self._version
681-
return f"{self.__class__.__name__}/{package}/{version}"
682+
base_agent = f"{self.__class__.__name__}/{package}/{version}"
683+
684+
deployment_uuid = os.environ.get("AGENT_WORKSPACE_DEPLOYMENT_UUID")
685+
if deployment_uuid:
686+
return f"{base_agent}/GRADIENT_ADK_AGENT/{deployment_uuid}"
687+
return base_agent
682688

683689
@property
684690
def base_url(self) -> URL:

0 commit comments

Comments
 (0)