ziya 0.1.5__tar.gz → 0.1.7__tar.gz
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.
- {ziya-0.1.5 → ziya-0.1.7}/PKG-INFO +1 -1
- {ziya-0.1.5 → ziya-0.1.7}/app/agents/agent.py +1 -1
- {ziya-0.1.5 → ziya-0.1.7}/app/main.py +50 -30
- ziya-0.1.7/app/utils/langchain_validation_util.py +16 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/utils/version_util.py +2 -2
- {ziya-0.1.5 → ziya-0.1.7}/pyproject.toml +1 -1
- {ziya-0.1.5 → ziya-0.1.7}/LICENSE +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/README.md +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/__init__.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/agents/__init__.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/agents/prompts.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/server.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/utils/__init__.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/utils/directory_util.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/utils/gitignore_parser.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/utils/logging_utils.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/app/utils/print_tree_util.py +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/static/app.js +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/static/favicon.ico +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/static/sendPayload.js +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/static/ziya.css +0 -0
- {ziya-0.1.5 → ziya-0.1.7}/templates/index.html +0 -0
|
@@ -38,7 +38,7 @@ logger.info(f"Using Claude Model: {model_id}")
|
|
|
38
38
|
|
|
39
39
|
model = ChatBedrock(
|
|
40
40
|
model_id=model_id,
|
|
41
|
-
model_kwargs={"max_tokens": 4096},
|
|
41
|
+
model_kwargs={"max_tokens": 4096, "temperature": 0.3, "top_k": 15},
|
|
42
42
|
credentials_profile_name=aws_profile if aws_profile else None,
|
|
43
43
|
config=botocore.config.Config(
|
|
44
44
|
read_timeout=900
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
+
import argparse
|
|
1
2
|
import os
|
|
2
3
|
import subprocess
|
|
3
4
|
import sys
|
|
4
5
|
from typing import Optional
|
|
5
6
|
|
|
6
7
|
from langchain_cli.cli import serve
|
|
7
|
-
import argparse
|
|
8
8
|
|
|
9
9
|
from app.utils.logging_utils import logger
|
|
10
|
+
from app.utils.langchain_validation_util import validate_langchain_vars
|
|
10
11
|
from app.utils.version_util import get_current_version, get_latest_version
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
def
|
|
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
|
-
|
|
23
|
-
def main():
|
|
24
|
-
os.environ["ZIYA_USER_CODEBASE_DIR"] = os.getcwd()
|
|
25
|
-
|
|
14
|
+
def parse_arguments():
|
|
26
15
|
parser = argparse.ArgumentParser(description="Run with custom options")
|
|
27
16
|
parser.add_argument("--exclude", default=[], type=lambda x: x.split(','),
|
|
28
17
|
help="List of files or directories to exclude (e.g., --exclude 'tst,build,*.py')")
|
|
@@ -31,29 +20,21 @@ def main():
|
|
|
31
20
|
parser.add_argument("--profile", type=str, default=None,
|
|
32
21
|
help="AWS profile to use (e.g., --profile ziya)")
|
|
33
22
|
parser.add_argument("--model", type=str, choices=["sonnet", "haiku", "opus"], default="sonnet",
|
|
34
|
-
help="AWS Bedrock Model to use
|
|
23
|
+
help="AWS Bedrock Model to use (e.g., --model sonnet)")
|
|
35
24
|
parser.add_argument("--port", type=int, default=6969,
|
|
36
25
|
help="Port number to run Ziya frontend on (e.g., --port 8080)")
|
|
37
26
|
parser.add_argument("--version", action="store_true",
|
|
38
27
|
help="Prints the version of Ziya")
|
|
39
|
-
|
|
28
|
+
return parser.parse_args()
|
|
40
29
|
|
|
41
|
-
current_version = get_current_version()
|
|
42
|
-
latest_version = get_latest_version()
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
|
|
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.")
|
|
31
|
+
def setup_environment(args):
|
|
32
|
+
os.environ["ZIYA_USER_CODEBASE_DIR"] = os.getcwd()
|
|
52
33
|
|
|
53
|
-
additional_excluded_dirs = ','.join(
|
|
34
|
+
additional_excluded_dirs = ','.join(args.exclude)
|
|
54
35
|
os.environ["ZIYA_ADDITIONAL_EXCLUDE_DIRS"] = additional_excluded_dirs
|
|
55
36
|
|
|
56
|
-
additional_included_dirs = ','.join(
|
|
37
|
+
additional_included_dirs = ','.join(args.include)
|
|
57
38
|
os.environ["ZIYA_ADDITIONAL_INCLUDE_DIRS"] = additional_included_dirs
|
|
58
39
|
|
|
59
40
|
if args.profile:
|
|
@@ -61,10 +42,49 @@ def main():
|
|
|
61
42
|
if args.model:
|
|
62
43
|
os.environ["ZIYA_AWS_MODEL"] = args.model
|
|
63
44
|
|
|
64
|
-
|
|
65
|
-
|
|
45
|
+
|
|
46
|
+
def check_version_and_upgrade():
|
|
47
|
+
current_version = get_current_version()
|
|
48
|
+
latest_version = get_latest_version()
|
|
49
|
+
|
|
50
|
+
if latest_version and current_version != latest_version:
|
|
51
|
+
update_package(current_version, latest_version)
|
|
52
|
+
else:
|
|
53
|
+
logger.info(f"Ziya version {current_version} is up to date.")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def update_package(current_version: str, latest_version: Optional[str]) -> None:
|
|
57
|
+
try:
|
|
58
|
+
logger.info(f"Updating ziya from {current_version} to {latest_version}")
|
|
59
|
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', 'ziya'])
|
|
60
|
+
logger.info("Update completed. Next time you run ziya it will be with the latest version.")
|
|
61
|
+
|
|
62
|
+
except Exception as e:
|
|
63
|
+
logger.info(f"Unexpected error upgrading ziya: {e}")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def print_version():
|
|
67
|
+
current_version = get_current_version()
|
|
68
|
+
print(f"Ziya version {current_version}")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def start_server(args):
|
|
72
|
+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
|
66
73
|
serve(port=args.port)
|
|
67
74
|
|
|
68
75
|
|
|
76
|
+
def main():
|
|
77
|
+
args = parse_arguments()
|
|
78
|
+
|
|
79
|
+
if args.version:
|
|
80
|
+
print_version()
|
|
81
|
+
return
|
|
82
|
+
|
|
83
|
+
check_version_and_upgrade()
|
|
84
|
+
validate_langchain_vars()
|
|
85
|
+
setup_environment(args)
|
|
86
|
+
start_server(args)
|
|
87
|
+
|
|
88
|
+
|
|
69
89
|
if __name__ == "__main__":
|
|
70
90
|
main()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
from app.utils.logging_utils import logger
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def validate_langchain_vars():
|
|
8
|
+
langchain_vars = [var for var in os.environ if var.startswith("LANGCHAIN_")]
|
|
9
|
+
if langchain_vars:
|
|
10
|
+
logger.error("Langchain environment variables are set:")
|
|
11
|
+
for var in langchain_vars:
|
|
12
|
+
logger.error(f"- {var}")
|
|
13
|
+
logger.error(
|
|
14
|
+
"To prevent accidentally sending confidential code to a 3rd party, please unset these variables before "
|
|
15
|
+
"running Ziya.")
|
|
16
|
+
sys.exit(1)
|
|
@@ -14,8 +14,8 @@ def get_latest_version() -> Optional[str]:
|
|
|
14
14
|
return None
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def update_package(
|
|
18
|
-
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade',
|
|
17
|
+
def update_package() -> None:
|
|
18
|
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', 'ziya'])
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def get_current_version() -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|