Skip to content

Commit 78c8595

Browse files
committed
release 0.5.19
1 parent 214deb3 commit 78c8595

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "veadk-python"
3-
version = "0.5.18"
3+
version = "0.5.19"
44
description = "Volcengine agent development kit, integrations with Volcengine cloud services."
55
readme = "README.md"
66
requires-python = ">=3.10"

veadk/config.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
env_from_dotenv = {}
5050
logger.info("No `.env` file found.")
5151

52+
provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
53+
if provider == "byteplus":
54+
byteplus_access_key = os.getenv("BYTEPLUS_ACCESS_KEY")
55+
if byteplus_access_key:
56+
os.environ["VOLCENGINE_ACCESS_KEY"] = byteplus_access_key
57+
byteplus_secret_key = os.getenv("BYTEPLUS_SECRET_KEY")
58+
if byteplus_secret_key:
59+
os.environ["VOLCENGINE_SECRET_KEY"] = byteplus_secret_key
60+
5261

5362
class VeADKConfig(BaseModel):
5463
model: ModelConfig = Field(default_factory=ModelConfig)
@@ -90,6 +99,20 @@ def getenv(
9099
"""
91100
value = os.getenv(env_name, default_value)
92101

102+
if value == default_value or not value:
103+
provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
104+
if provider == "byteplus":
105+
if env_name == "VOLCENGINE_ACCESS_KEY":
106+
byteplus_key = os.getenv("BYTEPLUS_ACCESS_KEY")
107+
if byteplus_key:
108+
os.environ["VOLCENGINE_ACCESS_KEY"] = byteplus_key
109+
value = byteplus_key
110+
elif env_name == "VOLCENGINE_SECRET_KEY":
111+
byteplus_key = os.getenv("BYTEPLUS_SECRET_KEY")
112+
if byteplus_key:
113+
os.environ["VOLCENGINE_SECRET_KEY"] = byteplus_key
114+
value = byteplus_key
115+
93116
if allow_false_values:
94117
return value
95118

veadk/utils/misc.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ def set_envs(config_yaml_path: str, env_from_dotenv: dict = None) -> tuple[dict,
152152
continue
153153
veadk_environments[k] = str(config_upper_map.get(k))
154154
os.environ[k] = str(config_upper_map.get(k))
155+
156+
provider = (os.getenv("CLOUD_PROVIDER") or "").lower()
157+
if provider == "byteplus":
158+
byteplus_access_key = veadk_environments.get("BYTEPLUS_ACCESS_KEY")
159+
if byteplus_access_key:
160+
os.environ["VOLCENGINE_ACCESS_KEY"] = byteplus_access_key
161+
byteplus_secret_key = veadk_environments.get("BYTEPLUS_SECRET_KEY")
162+
if byteplus_secret_key:
163+
os.environ["VOLCENGINE_SECRET_KEY"] = byteplus_secret_key
164+
155165
return config_dict, veadk_environments
156166

157167

veadk/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION = "0.5.18"
15+
VERSION = "0.5.19"

0 commit comments

Comments
 (0)