diff --git a/pyproject.toml b/pyproject.toml index 4af3a85b..bd5eea6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,4 +64,10 @@ dev = [ [tool.setuptools.packages.find] include = ["veadk*"] -exclude = ["app*", "assets*", "examples*", "ide*", "tests*",] +exclude = ["assets*", "ide*", "tests*"] + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.package-data] +"veadk.cli.studio.web" = ["_next/**/*"] \ No newline at end of file diff --git a/veadk/cli/services/vefaas/template/src/requirements.txt b/veadk/cli/services/vefaas/template/src/requirements.txt index aaca93f9..423f10f6 100644 --- a/veadk/cli/services/vefaas/template/src/requirements.txt +++ b/veadk/cli/services/vefaas/template/src/requirements.txt @@ -1,3 +1,4 @@ -git+https://github.com/volcengine/veadk-python.git +veadk-python[eval] @ git+https://github.com/volcengine/veadk-python.git # extra eval for prompt optimization in veadk studio +agent-pilot-sdk>=0.0.9 # extra dep for prompt optimization in veadk studio uvicorn[standard] fastapi \ No newline at end of file diff --git a/veadk/cli/services/vefaas/template/src/studio_agent.py b/veadk/cli/services/vefaas/template/src/studio_app.py similarity index 100% rename from veadk/cli/services/vefaas/template/src/studio_agent.py rename to veadk/cli/services/vefaas/template/src/studio_app.py diff --git a/veadk/cli/studio/web/__init__.py b/veadk/cli/studio/web/__init__.py new file mode 100644 index 00000000..7f463206 --- /dev/null +++ b/veadk/cli/studio/web/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/veadk/cloud/cloud_agent_engine.py b/veadk/cloud/cloud_agent_engine.py index 4e56af38..b58de229 100644 --- a/veadk/cloud/cloud_agent_engine.py +++ b/veadk/cloud/cloud_agent_engine.py @@ -71,6 +71,21 @@ def _prepare(self, path: str, name: str): shutil.copy(template_app_py, os.path.join(path, "app.py")) + if os.path.exists(os.path.join(path, "studio_app.py")): + logger.warning( + f"Local agent project path `{path}` contains an `studio_app.py` file. Use your own `studio_app.py` file may cause unexpected behavior." + ) + else: + logger.info( + f"No `studio_app.py` detected in local agent project path `{path}`. Prepare it." + ) + template_studio_app_py = ( + f"{Path(__file__).resolve().parent.resolve()}/template/studio_app.py" + ) + import shutil + + shutil.copy(template_studio_app_py, os.path.join(path, "studio_app.py")) + if os.path.exists(os.path.join(path, "run.sh")): logger.warning( f"Local agent project path `{path}` contains a `run.sh` file. Use your own `run.sh` file may cause unexpected behavior." @@ -104,6 +119,11 @@ def deploy( Returns: str: Volcengine FaaS function endpoint. """ + # prevent deepeval writing operations + import veadk.config + + veadk.config.veadk_environments["DEEPEVAL_TELEMETRY_OPT_OUT"] = "YES" + if use_studio: import veadk.config diff --git a/veadk/cloud/template/studio_agent.py b/veadk/cloud/template/studio_app.py similarity index 100% rename from veadk/cloud/template/studio_agent.py rename to veadk/cloud/template/studio_app.py