1- import os
21from collections .abc import Callable , Iterable
32from typing import Any , Optional
43
54from typing_extensions import deprecated
65
6+ from workflowai import env
77from workflowai .core .client ._types import AgentDecorator
88from workflowai .core .client .client import WorkflowAI as WorkflowAI
99from workflowai .core .domain import model
@@ -23,8 +23,8 @@ def _build_client(
2323 default_version : Optional [VersionReference ] = None ,
2424):
2525 return WorkflowAI (
26- endpoint = endpoint or os . getenv ( " WORKFLOWAI_API_URL" ) ,
27- api_key = api_key or os . getenv ( " WORKFLOWAI_API_KEY" , "" ) ,
26+ endpoint = endpoint or env . WORKFLOWAI_API_URL ,
27+ api_key = api_key or env . WORKFLOWAI_API_KEY ,
2828 default_version = default_version ,
2929 )
3030
@@ -33,7 +33,7 @@ def _build_client(
3333shared_client : WorkflowAI = _build_client ()
3434
3535# The default model to use when running agents without a deployment
36- DEFAULT_MODEL : "model.ModelOrStr" = os . getenv ( " WORKFLOWAI_DEFAULT_MODEL" , "gemini-1.5-pro-latest" )
36+ DEFAULT_MODEL : "model.ModelOrStr" = env . WORKFLOWAI_DEFAULT_MODEL
3737
3838
3939def init (api_key : Optional [str ] = None , url : Optional [str ] = None , default_version : Optional [VersionReference ] = None ):
0 commit comments