Skip to content

Commit d0518f7

Browse files
Chore: update studio web (#23)
* fix: fix studio import * chore: update studio web * remove useless print * change read envs from module * remove useless functions in vefaas
1 parent c5f43d8 commit d0518f7

File tree

13 files changed

+30
-61
lines changed

13 files changed

+30
-61
lines changed

veadk/cli/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import typer
2525
import uvicorn
2626

27-
from veadk.cli.studio.fast_api import get_fast_api_app
2827
from veadk.utils.logger import get_logger
2928
from veadk.version import VERSION
3029

@@ -153,6 +152,8 @@ def web(
153152
def studio(
154153
path: str = typer.Option(".", "--path", help="Project path"),
155154
):
155+
from veadk.cli.studio.fast_api import get_fast_api_app
156+
156157
path = Path(path).resolve()
157158

158159
agent_py_path = os.path.join(path, "agent.py")

veadk/cli/services/vefaas/vefaas.py

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import importlib.util
1615
import json
1716
import time
1817

@@ -28,7 +27,6 @@
2827
)
2928

3029
from veadk.cli.services.veapig.apig import APIGateway
31-
from veadk.config import veadk_environments
3230
from veadk.utils.logger import get_logger
3331
from veadk.utils.misc import formatted_timestamp
3432
from veadk.utils.volcengine_sign import ve_request
@@ -60,36 +58,6 @@ def __init__(self, access_key: str, secret_key: str, region: str = "cn-beijing")
6058

6159
self.template_id = "6874f3360bdbc40008ecf8c7"
6260

63-
def _pre_check(self, path: str):
64-
if not path.exists():
65-
raise ValueError(f"Path {path} does not exist.")
66-
67-
index_py_path = path / "index.py"
68-
if not index_py_path.exists():
69-
raise ValueError(
70-
"The project directory must include the `index.py` file. See: https://www.volcengine.com/docs/6662/107432"
71-
)
72-
typer.echo(
73-
typer.style(
74-
"Check `index.py` file pass.",
75-
fg=typer.colors.BRIGHT_BLACK,
76-
),
77-
)
78-
79-
spec = importlib.util.spec_from_file_location("index", index_py_path)
80-
module = importlib.util.module_from_spec(spec)
81-
spec.loader.exec_module(module)
82-
if not (hasattr(module, "handler") and callable(module.handler)):
83-
raise ValueError(
84-
"The `index.py` file must include a `handler` function. See: https://www.volcengine.com/docs/6662/107432"
85-
)
86-
typer.echo(
87-
typer.style(
88-
"Check `handler` function pass.",
89-
fg=typer.colors.BRIGHT_BLACK,
90-
),
91-
)
92-
9361
def _create_function(self, name: str, path: str):
9462
function_name = f"{name}-fn-{formatted_timestamp()}"
9563

@@ -99,7 +67,10 @@ def _create_function(self, name: str, path: str):
9967
)
10068

10169
envs = []
102-
for key, value in veadk_environments.items():
70+
71+
import veadk.config
72+
73+
for key, value in veadk.config.veadk_environments.items():
10374
envs.append(EnvForCreateFunctionInput(key=key, value=value))
10475
typer.echo(
10576
typer.style(
@@ -166,9 +137,6 @@ def _create_function(self, name: str, path: str):
166137

167138
return function_name, function_id
168139

169-
def _get_template(self):
170-
pass
171-
172140
def _create_application(
173141
self,
174142
application_name: str,

veadk/cli/studio/web/404.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

veadk/cli/studio/web/_next/static/psspzzoILImmFjgieicga/_buildManifest.js renamed to veadk/cli/studio/web/_next/static/CAa-wD_dU_yJ-FVDcKvQG/_buildManifest.js

File renamed without changes.

veadk/cli/studio/web/_next/static/psspzzoILImmFjgieicga/_ssgManifest.js renamed to veadk/cli/studio/web/_next/static/CAa-wD_dU_yJ-FVDcKvQG/_ssgManifest.js

File renamed without changes.

veadk/cli/studio/web/_next/static/chunks/app/run/page-831f50ef6d15e495.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

veadk/cli/studio/web/_next/static/chunks/app/run/page-e13208f1c7fe6748.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

veadk/cli/studio/web/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

veadk/cli/studio/web/index.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
:HL["/_next/static/media/569ce4b8f30dc480-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
1111
:HL["/_next/static/media/93f479601ee12b01-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
1212
:HL["/_next/static/css/366cfdd7fdd8bcac.css","style"]
13-
0:{"P":null,"b":"psspzzoILImmFjgieicga","p":"","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/366cfdd7fdd8bcac.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__variable_5cfdac __variable_9a8899 antialiased flex flex-col min-h-dvh max-h-dvh w-full","children":[["$","div",null,{"className":"flex w-full","children":["$","header",null,{"className":"px-4 md:px-6 w-full","children":["$","div",null,{"className":"flex h-16 items-center justify-between gap-4","children":[["$","div",null,{"className":"flex flex-1 items-center gap-2","children":[["$","$L2",null,{"children":[["$","$L3",null,{"asChild":true,"children":["$","button",null,{"data-slot":"button","className":"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 group size-8 md:hidden","children":["$","svg",null,{"className":"pointer-events-none","width":16,"height":16,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M4 12L20 12","className":"origin-center -translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-x-0 group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[315deg]"}],["$","path",null,{"d":"M4 12H20","className":"origin-center transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.8)] group-aria-expanded:rotate-45"}],["$","path",null,{"d":"M4 12H20","className":"origin-center translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[135deg]"}]]}]}]}],["$","$L4",null,{"align":"start","className":"w-36 p-1 md:hidden","children":["$","$L5",null,{"data-slot":"navigation-menu","data-viewport":true,"className":"group/navigation-menu relative flex flex-1 items-center justify-center max-w-none *:w-full","children":[["$","$L6",null,{"data-slot":"navigation-menu-list","className":"group flex flex-1 list-none justify-center flex-col items-start gap-0 md:gap-2","children":[[["$","$L7","0",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"https://volcengine.github.io/veadk-python/","target":"_blank","children":"Documents"}]}],["$","$L7","1",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"/","target":"_blank","children":"Studio"}]}]],"$L9","$La","$Lb"]}],"$Lc"]}]}]]}],"$Ld"]}],"$Le"]}]}]}],"$Lf","$L10"]}]}]]}],{"children":["__PAGE__","$L11",{},null,false]},null,false],"$L12",false]],"m":"$undefined","G":["$13",[]],"s":false,"S":true}
13+
0:{"P":null,"b":"CAa-wD_dU_yJ-FVDcKvQG","p":"","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/366cfdd7fdd8bcac.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__variable_5cfdac __variable_9a8899 antialiased flex flex-col min-h-dvh max-h-dvh w-full","children":[["$","div",null,{"className":"flex w-full","children":["$","header",null,{"className":"px-4 md:px-6 w-full","children":["$","div",null,{"className":"flex h-16 items-center justify-between gap-4","children":[["$","div",null,{"className":"flex flex-1 items-center gap-2","children":[["$","$L2",null,{"children":[["$","$L3",null,{"asChild":true,"children":["$","button",null,{"data-slot":"button","className":"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 group size-8 md:hidden","children":["$","svg",null,{"className":"pointer-events-none","width":16,"height":16,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round","xmlns":"http://www.w3.org/2000/svg","children":[["$","path",null,{"d":"M4 12L20 12","className":"origin-center -translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-x-0 group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[315deg]"}],["$","path",null,{"d":"M4 12H20","className":"origin-center transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.8)] group-aria-expanded:rotate-45"}],["$","path",null,{"d":"M4 12H20","className":"origin-center translate-y-[7px] transition-all duration-300 ease-[cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[135deg]"}]]}]}]}],["$","$L4",null,{"align":"start","className":"w-36 p-1 md:hidden","children":["$","$L5",null,{"data-slot":"navigation-menu","data-viewport":true,"className":"group/navigation-menu relative flex flex-1 items-center justify-center max-w-none *:w-full","children":[["$","$L6",null,{"data-slot":"navigation-menu-list","className":"group flex flex-1 list-none justify-center flex-col items-start gap-0 md:gap-2","children":[[["$","$L7","0",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"https://volcengine.github.io/veadk-python/","target":"_blank","children":"Documents"}]}],["$","$L7","1",{"data-slot":"navigation-menu-item","className":"relative w-full","children":["$","$L8",null,{"data-slot":"navigation-menu-link","className":"data-[active]:focus:bg-accent data-[active]:hover:bg-accent data-[active]:bg-accent data-[active]:text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 py-1.5","href":"/","target":"_blank","children":"Studio"}]}]],"$L9","$La","$Lb"]}],"$Lc"]}]}]]}],"$Ld"]}],"$Le"]}]}]}],"$Lf","$L10"]}]}]]}],{"children":["__PAGE__","$L11",{},null,false]},null,false],"$L12",false]],"m":"$undefined","G":["$13",[]],"s":false,"S":true}
1414
14:I[61223,["527","static/chunks/527-1c65afbb202752bd.js","4357","static/chunks/4357-39eb6b5934ac97db.js","261","static/chunks/261-19b52c2c85aefb5d.js","7177","static/chunks/app/layout-b0d50d105c55fd6d.js"],"Viewport"]
1515
15:I[92945,["527","static/chunks/527-1c65afbb202752bd.js","4357","static/chunks/4357-39eb6b5934ac97db.js","261","static/chunks/261-19b52c2c85aefb5d.js","7177","static/chunks/app/layout-b0d50d105c55fd6d.js"],"GithubIcon"]
1616
16:I[17885,["527","static/chunks/527-1c65afbb202752bd.js","4357","static/chunks/4357-39eb6b5934ac97db.js","261","static/chunks/261-19b52c2c85aefb5d.js","7177","static/chunks/app/layout-b0d50d105c55fd6d.js"],"default"]

veadk/cli/studio/web/run.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)