ziya 0.1.4__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ziya might be problematic. Click here for more details.
- app/main.py +33 -1
- app/utils/version_util.py +23 -0
- pyproject.toml +1 -1
- {ziya-0.1.4.dist-info → ziya-0.1.5.dist-info}/METADATA +1 -1
- {ziya-0.1.4.dist-info → ziya-0.1.5.dist-info}/RECORD +8 -7
- {ziya-0.1.4.dist-info → ziya-0.1.5.dist-info}/LICENSE +0 -0
- {ziya-0.1.4.dist-info → ziya-0.1.5.dist-info}/WHEEL +0 -0
- {ziya-0.1.4.dist-info → ziya-0.1.5.dist-info}/entry_points.txt +0 -0
app/main.py
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
2
6
|
from langchain_cli.cli import serve
|
|
3
7
|
import argparse
|
|
4
8
|
|
|
9
|
+
from app.utils.logging_utils import logger
|
|
10
|
+
from app.utils.version_util import get_current_version, get_latest_version
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def update_package(current_version: str, latest_version: Optional[str]) -> None:
|
|
14
|
+
try:
|
|
15
|
+
logger.info(f"Updating ziya from {current_version} to {latest_version}")
|
|
16
|
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', 'ziya'])
|
|
17
|
+
logger.info("Update completed. Next time you run ziya it will be with the latest version.")
|
|
18
|
+
|
|
19
|
+
except Exception as e:
|
|
20
|
+
logger.info(f"Unexpected error upgrading ziya: {e}")
|
|
21
|
+
|
|
22
|
+
|
|
5
23
|
def main():
|
|
6
24
|
os.environ["ZIYA_USER_CODEBASE_DIR"] = os.getcwd()
|
|
7
25
|
|
|
@@ -16,8 +34,22 @@ def main():
|
|
|
16
34
|
help="AWS Bedrock Model to use (e.g., --model sonnet)")
|
|
17
35
|
parser.add_argument("--port", type=int, default=6969,
|
|
18
36
|
help="Port number to run Ziya frontend on (e.g., --port 8080)")
|
|
37
|
+
parser.add_argument("--version", action="store_true",
|
|
38
|
+
help="Prints the version of Ziya")
|
|
19
39
|
args = parser.parse_args()
|
|
20
40
|
|
|
41
|
+
current_version = get_current_version()
|
|
42
|
+
latest_version = get_latest_version()
|
|
43
|
+
|
|
44
|
+
if args.version:
|
|
45
|
+
print(f"Ziya version {current_version}")
|
|
46
|
+
return
|
|
47
|
+
|
|
48
|
+
if latest_version and current_version != latest_version:
|
|
49
|
+
update_package(current_version, latest_version)
|
|
50
|
+
else:
|
|
51
|
+
logger.info(f"Ziya version {current_version} is up to date.")
|
|
52
|
+
|
|
21
53
|
additional_excluded_dirs = ','.join([item for item in args.exclude])
|
|
22
54
|
os.environ["ZIYA_ADDITIONAL_EXCLUDE_DIRS"] = additional_excluded_dirs
|
|
23
55
|
|
|
@@ -35,4 +67,4 @@ def main():
|
|
|
35
67
|
|
|
36
68
|
|
|
37
69
|
if __name__ == "__main__":
|
|
38
|
-
main()
|
|
70
|
+
main()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from packaging import version
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def get_latest_version() -> Optional[str]:
|
|
9
|
+
try:
|
|
10
|
+
response = requests.get('https://pypi.org/pypi/ziya/json')
|
|
11
|
+
response.raise_for_status()
|
|
12
|
+
return str(version.parse(response.json()['info']['version']))
|
|
13
|
+
except requests.exceptions.RequestException:
|
|
14
|
+
return None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def update_package(package_name: str) -> None:
|
|
18
|
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', package_name])
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_current_version() -> str:
|
|
22
|
+
from importlib.metadata import version
|
|
23
|
+
return str(version('ziya'))
|
pyproject.toml
CHANGED
|
@@ -2,21 +2,22 @@ app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
app/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
app/agents/agent.py,sha256=Qb1xgZ7fkpLSbKzSsygze7UL2H8jMtnOiTD-Gm8uXWU,4349
|
|
4
4
|
app/agents/prompts.py,sha256=O54rH2KupyY7ZSjPEvm3j9DSGjdL3jJOz8F9PTcePQQ,1674
|
|
5
|
-
app/main.py,sha256=
|
|
5
|
+
app/main.py,sha256=N0cANRDCHi-NWfD6yPFOz21t-Nld6RIEjKBJTbvI2mI,2827
|
|
6
6
|
app/server.py,sha256=YTEHYUsFQhgkGRHZ_y7K3Ju3SmUIbVxLSdgrgi1BuEU,676
|
|
7
7
|
app/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
app/utils/directory_util.py,sha256=fdYumUhLcmbaGI0OvGY13CkQSKxrCZi6ZNwhz9_oJmQ,2512
|
|
9
9
|
app/utils/gitignore_parser.py,sha256=ksAAvXr8_GFh94cvOdkLmES5k3xxNxW2_tQuQtialIA,7496
|
|
10
10
|
app/utils/logging_utils.py,sha256=8JEcc1t7L-a0G4HLmM8zFydNNSOd5l2-gkTxviLQUns,280
|
|
11
11
|
app/utils/print_tree_util.py,sha256=O4Rb-GS8UODxfH7Z6bZGsr-opG6QLmvdaU1im5kh4IA,1419
|
|
12
|
-
|
|
12
|
+
app/utils/version_util.py,sha256=XZfjrdqplkSaabuPKtuXBWhIadC3y6QULnbmpjC2FsU,654
|
|
13
|
+
pyproject.toml,sha256=iSyoY1vYx766WHWMvsRAvSsQRG6Kacf-59AIED2Qb3A,716
|
|
13
14
|
static/app.js,sha256=qz2F0e5LxuVFI3MXWvcON9l1cN0J_ODdQOwbgT3ZqWA,3622
|
|
14
15
|
static/favicon.ico,sha256=HgB8xAZdDHFK2lODUsp2H_Dds_i14pnpydx7NEJrNrU,15086
|
|
15
16
|
static/sendPayload.js,sha256=VnypSWF7t8bv83026LGU3GMyr9tMrp05hmWATcbCG4k,1956
|
|
16
17
|
static/ziya.css,sha256=OaieSXw_7LOk0WNNi-1mPsAaS3rOxhHycKFgFDoiZB0,1395
|
|
17
18
|
templates/index.html,sha256=8auy9lGLdcDzBkzpjYB1ygrAVbXpo0rqQ8p1FgMEeck,800
|
|
18
|
-
ziya-0.1.
|
|
19
|
-
ziya-0.1.
|
|
20
|
-
ziya-0.1.
|
|
21
|
-
ziya-0.1.
|
|
22
|
-
ziya-0.1.
|
|
19
|
+
ziya-0.1.5.dist-info/LICENSE,sha256=8CfErGEG13yY1Z-CDlIhAQawX2KOv-QI_2Ge2z6x8SU,1064
|
|
20
|
+
ziya-0.1.5.dist-info/METADATA,sha256=L3KA_gFHYIaSHaaduEstj7PE62GVuwxTESJrT72Uh0s,2921
|
|
21
|
+
ziya-0.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
+
ziya-0.1.5.dist-info/entry_points.txt,sha256=1HspxMqCYRli3SqM6CqmT6gsW_G14G4ab3sHlrYUCAA,38
|
|
23
|
+
ziya-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|