ziya 0.1.22__py3-none-any.whl → 0.1.24__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/agents/agent.py CHANGED
@@ -67,47 +67,10 @@ def get_combined_docs_from_files(files) -> str:
67
67
  print("--------------------------------------------------------")
68
68
  return combined_contents
69
69
 
70
- # def get_combined_document_contents_from_included_dirs(included_relative_dirs) -> str:
71
- # user_codebase_dir: str = os.environ["ZIYA_USER_CODEBASE_DIR"]
72
- # print(f"Reading user's current codebase: {user_codebase_dir}")
73
- #
74
- # combined_contents: str = ""
75
- # ignored_patterns: List[str] = get_ignored_patterns(user_codebase_dir)
76
- # all_files: List[str] = get_complete_file_list(user_codebase_dir, ignored_patterns, included_relative_dirs)
77
- # print("all_files")
78
- # print(all_files)
79
- #
80
- # print_file_tree(all_files)
81
- #
82
- # seen_dirs: Set[str] = set()
83
- # for file_path in all_files:
84
- # try:
85
- # docs = TextLoader(file_path).load()
86
- # for doc in docs:
87
- # combined_contents += f"File: {file_path}\n{doc.page_content}\n\n"
88
- # dir_path = os.path.dirname(file_path)
89
- # if dir_path not in seen_dirs:
90
- # seen_dirs.add(dir_path)
91
- # except Exception as e:
92
- # print(f"Skipping file {file_path} due to error: {e}")
93
- #
94
- # print("--------------------------------------------------------")
95
- # print(f"Ignoring following paths based on gitIgnore and other defaults: {ignored_patterns}")
96
- # print("--------------------------------------------------------")
97
- # print(f"Codebase word count: {len(combined_contents.split()):,}")
98
- # token_count = len(tiktoken.get_encoding("cl100k_base").encode(combined_contents))
99
- # print(f"Codebase token count: {token_count:,}")
100
- # print(f"Max Claude Token limit: 200,000")
101
- # print("--------------------------------------------------------")
102
- # return combined_contents
103
-
104
- # prompt = conversational_prompt.partial(
105
- # # codebase=get_combined_document_contents()
106
- # )
70
+
107
71
  llm_with_stop = model.bind(stop=["</tool_input>"])
108
72
 
109
73
  def extract_codebase(x):
110
- # return get_combined_docs_from_files(x["config"].get("include_dirs", ['./']))
111
74
  return get_combined_docs_from_files(x["config"].get("files", []))
112
75
 
113
76
  agent = (
app/agents/prompts.py CHANGED
@@ -3,15 +3,22 @@ from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
3
3
  # import pydevd_pycharm
4
4
 
5
5
  template = """
6
- You are an excellent coder. Help the user with their coding tasks. You are given the entire codebase
7
- of the user in your context. It is in the format like below where first line has the File path and then the content follows.
6
+ You are an excellent coder. Help the user with their coding tasks. You are given the codebase
7
+ of the user in your context.
8
+
9
+ IMPORTANT: When recommending code changes, always format your response as a git diff unless the user specifies otherwise.
10
+
11
+ The codebase is provided at the end of this prompt in a specific format.
12
+ The code that the user has given to you for context is in the format like below where first line has the File path and then the content follows.
13
+ Each file starts with "File: <filepath>" followed by its content on subsequent lines.
8
14
 
9
15
  File: <filepath>
10
16
  <Content of the file>.
11
17
 
12
- Now below is the current codebase of the user:
13
-
18
+ Below is the current codebase of the user:
19
+
14
20
  {codebase}
21
+
15
22
  """
16
23
 
17
24
  conversational_prompt = ChatPromptTemplate.from_messages(
@@ -27,23 +34,4 @@ conversational_prompt = ChatPromptTemplate.from_messages(
27
34
 
28
35
  def parse_output(message):
29
36
  text = message.content
30
- # pydevd_pycharm.settrace('localhost', port=61565, stdoutToServer=True, stderrToServer=True)
31
- # print('----TEXT START----')
32
- # print(text)
33
- # print('----TEXT END----')
34
- # if "</tool>" in text:
35
- # tool, tool_input = text.split("</tool>")
36
- # _tool = tool.split("<tool>")[1]
37
- # _tool_input = tool_input.split("<tool_input>")[1]
38
- #
39
- # if _tool == "write_file":
40
- # _tool_input = json.loads(_tool_input)
41
- # # newline_index = _tool_input.find('\n')
42
- # # file_path = _tool_input[:newline_index]
43
- # # text = _tool_input[newline_index + 1:]
44
- # if "</tool_input>" in _tool_input:
45
- # _tool_input = _tool_input.split("</tool_input>")[0]
46
- #
47
- # return AgentAction(tool=_tool, tool_input=_tool_input, log=text)
48
- # else:
49
37
  return AgentFinish(return_values={"output": text}, log=text)
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ziya"
3
- version = "0.1.22"
3
+ version = "0.1.24"
4
4
  description = ""
5
5
  authors = ["Vishnu Krishnaprasad <vishnukool@gmail.com>"]
6
6
  readme = "README.md"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
- "main.css": "/static/css/main.987be07e.css",
4
- "main.js": "/static/js/main.e5e64dae.js",
3
+ "main.css": "/static/css/main.36c086ff.css",
4
+ "main.js": "/static/js/main.3967f091.js",
5
5
  "static/media/fa-solid-900.ttf": "/static/media/fa-solid-900.bacd5de623fb563b961a.ttf",
6
6
  "static/media/fa-brands-400.ttf": "/static/media/fa-brands-400.60127e352b7a11f7f1bc.ttf",
7
7
  "static/media/fa-solid-900.woff2": "/static/media/fa-solid-900.4d986b00ff9ca3828fbd.woff2",
@@ -11,11 +11,11 @@
11
11
  "static/media/fa-v4compatibility.ttf": "/static/media/fa-v4compatibility.c8e090db312b0bea2aa2.ttf",
12
12
  "static/media/fa-v4compatibility.woff2": "/static/media/fa-v4compatibility.cf7f5903d06b79ad60f1.woff2",
13
13
  "index.html": "/index.html",
14
- "main.987be07e.css.map": "/static/css/main.987be07e.css.map",
15
- "main.e5e64dae.js.map": "/static/js/main.e5e64dae.js.map"
14
+ "main.36c086ff.css.map": "/static/css/main.36c086ff.css.map",
15
+ "main.3967f091.js.map": "/static/js/main.3967f091.js.map"
16
16
  },
17
17
  "entrypoints": [
18
- "static/css/main.987be07e.css",
19
- "static/js/main.e5e64dae.js"
18
+ "static/css/main.36c086ff.css",
19
+ "static/js/main.3967f091.js"
20
20
  ]
21
21
  }
templates/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Ziya - Code Assistant</title><link rel="icon" href="/favicon.ico" type="image/x-icon"><script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script><script defer="defer" src="/static/js/main.e5e64dae.js"></script><link href="/static/css/main.987be07e.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Ziya - Code Assistant</title><link rel="icon" href="/favicon.ico" type="image/x-icon"><script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script><script defer="defer" src="/static/js/main.3967f091.js"></script><link href="/static/css/main.36c086ff.css" rel="stylesheet"></head><body><div id="root"></div></body></html>