beamlit 0.0.21__py3-none-any.whl → 0.0.22rc11__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,28 @@ class Config:
|
|
43
43
|
if self.context is None:
|
44
44
|
self.context = ContextConfig()
|
45
45
|
|
46
|
+
def to_json(self) -> dict:
|
47
|
+
return {
|
48
|
+
"workspaces": [
|
49
|
+
{
|
50
|
+
"name": ws.name,
|
51
|
+
"credentials": {
|
52
|
+
"api_key": ws.credentials.api_key,
|
53
|
+
"access_token": ws.credentials.access_token,
|
54
|
+
"refresh_token": ws.credentials.refresh_token,
|
55
|
+
"expires_in": ws.credentials.expires_in,
|
56
|
+
"device_code": ws.credentials.device_code,
|
57
|
+
"client_credentials": ws.credentials.client_credentials,
|
58
|
+
},
|
59
|
+
}
|
60
|
+
for ws in self.workspaces
|
61
|
+
],
|
62
|
+
"context": {
|
63
|
+
"workspace": self.context.workspace,
|
64
|
+
"environment": self.context.environment,
|
65
|
+
},
|
66
|
+
}
|
67
|
+
|
46
68
|
|
47
69
|
def load_config() -> Config:
|
48
70
|
config = Config()
|
@@ -68,23 +90,6 @@ def load_config() -> Config:
|
|
68
90
|
|
69
91
|
|
70
92
|
def save_config(config: Config):
|
71
|
-
data = {
|
72
|
-
"workspaces": [
|
73
|
-
{
|
74
|
-
"name": ws.name,
|
75
|
-
"credentials": {
|
76
|
-
"access_token": ws.credentials.access_token,
|
77
|
-
"api_key": ws.credentials.api_key,
|
78
|
-
},
|
79
|
-
}
|
80
|
-
for ws in config.workspaces
|
81
|
-
],
|
82
|
-
"context": {
|
83
|
-
"workspace": config.context.workspace,
|
84
|
-
"environment": config.context.environment,
|
85
|
-
},
|
86
|
-
}
|
87
|
-
|
88
93
|
home_dir = Path.home()
|
89
94
|
if not home_dir:
|
90
95
|
raise RuntimeError("Could not determine home directory")
|
@@ -93,9 +98,8 @@ def save_config(config: Config):
|
|
93
98
|
config_file = config_dir / "config.yaml"
|
94
99
|
|
95
100
|
config_dir.mkdir(mode=0o700, parents=True, exist_ok=True)
|
96
|
-
|
97
101
|
with open(config_file, "w", encoding="utf-8") as f:
|
98
|
-
yaml.dump(
|
102
|
+
yaml.dump(config.to_json(), f)
|
99
103
|
|
100
104
|
|
101
105
|
def list_workspaces() -> List[str]:
|
beamlit/common/settings.py
CHANGED
@@ -59,7 +59,7 @@ class Settings(BaseSettings):
|
|
59
59
|
)
|
60
60
|
|
61
61
|
workspace: str
|
62
|
-
environment: str
|
62
|
+
environment: str = Field(default="production")
|
63
63
|
type: str = Field(default="agent")
|
64
64
|
name: str = Field(default="beamlit-agent")
|
65
65
|
base_url: str = Field(default="https://api.beamlit.dev/v0")
|
@@ -132,13 +132,13 @@ beamlit/authentication/__init__.py,sha256=wiXqRbc7E-ulrH_ueA9duOGFvXeo7-RvhSD1Xb
|
|
132
132
|
beamlit/authentication/apikey.py,sha256=jnz1FMRauI5qAInqeeDER8aCONx4O8ZPZGedvi3Ap_o,659
|
133
133
|
beamlit/authentication/authentication.py,sha256=om26AteY2cCV9ctqbOCynX6PgS8YO-aCreNOFSnnWKc,3121
|
134
134
|
beamlit/authentication/clientcredentials.py,sha256=6kbfTjwUkXUArJX8XZLe9ZzbEicQc19tSXBvsTpiXMk,3954
|
135
|
-
beamlit/authentication/credentials.py,sha256=
|
135
|
+
beamlit/authentication/credentials.py,sha256=DBw598T6it7EgXKnS_qfsBM0mkC33iRDadWA70bg5X0,5349
|
136
136
|
beamlit/authentication/device_mode.py,sha256=oQVBCDsq-pdeXF31WSTAAEdaX6eACV7SYcOSyf3ea_Q,3728
|
137
137
|
beamlit/common/__init__.py,sha256=yDoMJDKj-xjTGl7U1YI59KpWxiOV65HSiUulgO8xdTA,277
|
138
138
|
beamlit/common/generate.py,sha256=VJ_MiRDulXdQdnlKdM4_Bod6CO6DOGlFiosGXOLuLGs,7227
|
139
139
|
beamlit/common/logger.py,sha256=ayabnsoHS8ncXm8EpBS01FkvSe0XRcaNdQjKVuPI5z4,1025
|
140
140
|
beamlit/common/secrets.py,sha256=sid81bOe3LflkMKDHwBsBs9nIju8bp5-v9qU9gkyNMc,212
|
141
|
-
beamlit/common/settings.py,sha256=
|
141
|
+
beamlit/common/settings.py,sha256=7PDfLPzTPN5Yeh2NnmAlSzpBi_u-qza2lUIX-i6N_lg,5252
|
142
142
|
beamlit/common/utils.py,sha256=jouz5igBvT37Xn_e94-foCHyQczVim-UzVcoIF6RWJ4,657
|
143
143
|
beamlit/functions/__init__.py,sha256=_RPG1Bfg54JGdIPnViAU6n9zD7E1cDNsdXi8oYGskzE,138
|
144
144
|
beamlit/functions/decorator.py,sha256=-2newMBztweIgFuh0ABKOdxCfUzWaRxf0ym-YAgggJI,3168
|
@@ -296,6 +296,6 @@ beamlit/serve/app.py,sha256=-CvUU7pqFDigndHpA01IR4_mxXaT8c0VsnVjMfIw6K8,2399
|
|
296
296
|
beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
|
297
297
|
beamlit/serve/middlewares/accesslog.py,sha256=wM52-hcwtO-_hdM1pnsEJzerzJf1MzEyN5m85BdDccE,609
|
298
298
|
beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
|
299
|
-
beamlit-0.0.
|
300
|
-
beamlit-0.0.
|
301
|
-
beamlit-0.0.
|
299
|
+
beamlit-0.0.22rc11.dist-info/METADATA,sha256=AOUr4a-4i_HzlZwKbn12EyaSvGR2BJFEFdzs4WXPqRw,2027
|
300
|
+
beamlit-0.0.22rc11.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
301
|
+
beamlit-0.0.22rc11.dist-info/RECORD,,
|
File without changes
|