ziya 0.1.7__py3-none-any.whl → 0.1.9__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.

Files changed (35) hide show
  1. app/agents/agent.py +55 -34
  2. app/agents/prompts.py +3 -1
  3. app/main.py +0 -5
  4. app/server.py +68 -2
  5. app/utils/directory_util.py +14 -9
  6. app/utils/gitignore_parser.py +1 -3
  7. pyproject.toml +7 -5
  8. scripts.py +42 -0
  9. templates/.DS_Store +0 -0
  10. templates/asset-manifest.json +21 -0
  11. templates/index.html +1 -19
  12. templates/static/css/main.85c755f1.css +8 -0
  13. templates/static/css/main.85c755f1.css.map +1 -0
  14. templates/static/js/main.d47d0f10.js +3 -0
  15. templates/static/js/main.d47d0f10.js.LICENSE.txt +39 -0
  16. templates/static/js/main.d47d0f10.js.map +1 -0
  17. templates/static/media/fa-brands-400.455ea818179b4def0c43.woff2 +0 -0
  18. templates/static/media/fa-brands-400.60127e352b7a11f7f1bc.ttf +0 -0
  19. templates/static/media/fa-regular-400.21cb8f55d8e0c5b89751.woff2 +0 -0
  20. templates/static/media/fa-regular-400.eb91f7b948a42799f678.ttf +0 -0
  21. templates/static/media/fa-solid-900.4d986b00ff9ca3828fbd.woff2 +0 -0
  22. templates/static/media/fa-solid-900.bacd5de623fb563b961a.ttf +0 -0
  23. templates/static/media/fa-v4compatibility.c8e090db312b0bea2aa2.ttf +0 -0
  24. templates/static/media/fa-v4compatibility.cf7f5903d06b79ad60f1.woff2 +0 -0
  25. {ziya-0.1.7.dist-info → ziya-0.1.9.dist-info}/METADATA +2 -1
  26. ziya-0.1.9.dist-info/RECORD +37 -0
  27. ziya-0.1.9.dist-info/entry_points.txt +7 -0
  28. static/app.js +0 -104
  29. static/sendPayload.js +0 -62
  30. static/ziya.css +0 -88
  31. ziya-0.1.7.dist-info/RECORD +0 -24
  32. ziya-0.1.7.dist-info/entry_points.txt +0 -3
  33. {static → templates}/favicon.ico +0 -0
  34. {ziya-0.1.7.dist-info → ziya-0.1.9.dist-info}/LICENSE +0 -0
  35. {ziya-0.1.7.dist-info → ziya-0.1.9.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ziya
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary:
5
5
  Author: Vishnu Krishnaprasad
6
6
  Author-email: vishnukool@gmail.com
@@ -18,6 +18,7 @@ Requires-Dist: langchain-aws (>=0.1.0,<0.2.0)
18
18
  Requires-Dist: langchain-cli (>=0.0.15)
19
19
  Requires-Dist: langchainhub (>=0.1.15)
20
20
  Requires-Dist: pydantic (<2)
21
+ Requires-Dist: pydevd-pycharm (>=241.15989.57,<242.0.0)
21
22
  Requires-Dist: tiktoken (>=0.6.0,<0.7.0)
22
23
  Requires-Dist: uvicorn (>=0.23.2,<0.24.0)
23
24
  Description-Content-Type: text/markdown
@@ -0,0 +1,37 @@
1
+ app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ app/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ app/agents/agent.py,sha256=l_GmvQ_G4eKwd_9h4tH325jnQDS3_-NYFAX2yKcypPw,5363
4
+ app/agents/prompts.py,sha256=LMwNzbYexns8er7mlF5VKhlobYH9yy37HR-axL_DNkk,1747
5
+ app/main.py,sha256=jm78WN0opAp-lk78mUTg7a-n68E322Jwy2fUosoIphE,2819
6
+ app/server.py,sha256=VqPlRQ-_14eI4Y9kIkcHrGW5uMxL6MPesD9bZrBvanQ,3199
7
+ app/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ app/utils/directory_util.py,sha256=2zxsSxSOZKesjhgjF3KguY__fC9XkjxHHnDbcxtnhXk,2762
9
+ app/utils/gitignore_parser.py,sha256=DnDqf7K6neeLTChcGD-x4g1UQ32pzgHh0qf7oP1mEDk,7425
10
+ app/utils/langchain_validation_util.py,sha256=RgmKayKMApvUA7SPF_DrBAcYdIzzLUVJfnOwTSc1Eug,527
11
+ app/utils/logging_utils.py,sha256=8JEcc1t7L-a0G4HLmM8zFydNNSOd5l2-gkTxviLQUns,280
12
+ app/utils/print_tree_util.py,sha256=O4Rb-GS8UODxfH7Z6bZGsr-opG6QLmvdaU1im5kh4IA,1419
13
+ app/utils/version_util.py,sha256=NcvMWIImJDcO9K5OMX6jJD4q6Zb8Y117Mu8sWIkhxEc,631
14
+ pyproject.toml,sha256=tk6CzFdz2bZfmxpy-X6vM04tSyPudKoD6ty-mqi0d5s,803
15
+ scripts.py,sha256=70BOvYoboMhl3Bxjy73m1ozmI8UV8JZVyi2RwUptkK8,809
16
+ templates/.DS_Store,sha256=IWzGxsqGRcdoSHwV5Q9YF26GaZGnTClZWzKJgx33UyY,6148
17
+ templates/asset-manifest.json,sha256=n5MC3sq_GAHk2L8kQ_Lmlrq_4apOWhlv8hi7lL_s5-o,1157
18
+ templates/favicon.ico,sha256=HgB8xAZdDHFK2lODUsp2H_Dds_i14pnpydx7NEJrNrU,15086
19
+ templates/index.html,sha256=bYtemyV0ohfvJ05Qpn7B9KgP2K5m4bULsNMYQNDSGzo,465
20
+ templates/static/css/main.85c755f1.css,sha256=_4DxN5K1KB-FJ5wg2VZVIYRTVvaFOuCGY1Rlu0mTiTg,103690
21
+ templates/static/css/main.85c755f1.css.map,sha256=iNe8qyUnAbD3kPz9meWoAFnWBDTry0RN9BxFuUwBRtg,151536
22
+ templates/static/js/main.d47d0f10.js,sha256=3c7QHWi-4dmAVLktgHmSCqwFnrCLhgCIuOe7FDfxPMY,191420
23
+ templates/static/js/main.d47d0f10.js.LICENSE.txt,sha256=vIOq_0PT75MBMxu_6qzE0thUnfyQKfeGvWq90yNjsCA,971
24
+ templates/static/js/main.d47d0f10.js.map,sha256=cLPtikrH4KpLzrztjR_92z_rbvlnMIMxqk6ljg2Nt_Y,481332
25
+ templates/static/media/fa-brands-400.455ea818179b4def0c43.woff2,sha256=IyxvanZ4ME-e-qJvMLFhDevCup9M1ja15nUcjXN2G5I,117852
26
+ templates/static/media/fa-brands-400.60127e352b7a11f7f1bc.ttf,sha256=4oCW-nWpasdwIBVeo6bdcxKYPoQRU2bUz0mgwxLsbVE,209128
27
+ templates/static/media/fa-regular-400.21cb8f55d8e0c5b89751.woff2,sha256=wn2m-DNDHaWqKVxEVAv6wP2CcLpqPENGQnAG2KezS3Y,25392
28
+ templates/static/media/fa-regular-400.eb91f7b948a42799f678.ttf,sha256=kXR1fvyD4HJDboc8Ir4WY9PBA7ChbX-3NWmvSRjU01E,67860
29
+ templates/static/media/fa-solid-900.4d986b00ff9ca3828fbd.woff2,sha256=rhfBavvqIWcHsiA-oc-b20W5v-R9D0rjJY3bxilN0C8,156400
30
+ templates/static/media/fa-solid-900.bacd5de623fb563b961a.ttf,sha256=tJkNDQxfXTjWLpNu6hIGdOWEx-6o3O44qXXAz5o3U5s,420332
31
+ templates/static/media/fa-v4compatibility.c8e090db312b0bea2aa2.ttf,sha256=_49SX7BQxdJFGczI9XI9hbLlHt0_m8ZUivVa663U8mk,10832
32
+ templates/static/media/fa-v4compatibility.cf7f5903d06b79ad60f1.woff2,sha256=x6hp-sopnRW-EKAfGdB2WnxNRtiSLZuTFyNcHkpvCYI,4792
33
+ ziya-0.1.9.dist-info/LICENSE,sha256=8CfErGEG13yY1Z-CDlIhAQawX2KOv-QI_2Ge2z6x8SU,1064
34
+ ziya-0.1.9.dist-info/METADATA,sha256=BANp7sZ_1YbisJxAXYo5prvLeOUQlEEWtZzl7Qhh7x8,2977
35
+ ziya-0.1.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ ziya-0.1.9.dist-info/entry_points.txt,sha256=6-KUolj5XXeOPVCJGTJgUL_3lDVGxG-YtK5BTvFPyBg,147
37
+ ziya-0.1.9.dist-info/RECORD,,
@@ -0,0 +1,7 @@
1
+ [console_scripts]
2
+ dev=scripts:dev
3
+ fbuild=scripts:frontend_build
4
+ finstall=scripts:frontend_install
5
+ fstart=scripts:frontend_start
6
+ ziya=scripts:ziya
7
+
static/app.js DELETED
@@ -1,104 +0,0 @@
1
- const {useState, useRef, useEffect} = React;
2
-
3
- const App = () => {
4
- const [messages, setMessages] = useState([]);
5
- const [question, setQuestion] = useState('');
6
- const [streamedContent, setStreamedContent] = useState('');
7
- const [isStreaming, setIsStreaming] = useState(false);
8
- const inputTextareaRef = useRef(null);
9
-
10
- useEffect(() => {
11
- if (inputTextareaRef.current) {
12
- inputTextareaRef.current.focus();
13
- }
14
- }, []);
15
-
16
- const handleSendPayload = async () => {
17
- setQuestion('');
18
- setIsStreaming(true);
19
- setMessages((messages) => [...messages, {content: question, role: 'human'}]);
20
- setStreamedContent('');
21
- await window.sendPayload(messages, question, setStreamedContent, setIsStreaming);
22
- setStreamedContent((cont) => {
23
- setMessages((messages) => [...messages, {content: cont, role: 'assistant'}]);
24
- return ""
25
- });
26
- inputTextareaRef.current.focus();
27
- };
28
-
29
- const handleChange = (event) => {
30
- setQuestion(event.target.value);
31
- };
32
-
33
- return (
34
- <div><h2 style={{textAlign: "center"}}>Ziya: Code Assist</h2>
35
- <div className="container">
36
- <InputContainer
37
- inputTextareaRef={inputTextareaRef}
38
- question={question}
39
- handleChange={handleChange}
40
- sendPayload={handleSendPayload}
41
- isStreaming={isStreaming}
42
- />
43
- {streamedContent || messages.length > 0 ? <div className="chat-container">
44
- {streamedContent && <StreamedContent streamedContent={streamedContent}/>}
45
- {messages.length > 0 && <ChatContainer messages={messages}/>}
46
- </div> : null}
47
- </div>
48
- </div>
49
- );
50
- };
51
-
52
- const ChatContainer = ({messages}) => (
53
- <div>
54
- {messages.slice().reverse().map((msg, index) => (
55
- <div key={index} className={`message ${msg.role}`}>
56
- {msg.role === 'human' ? <div className="message-sender">You:</div> :
57
- <div className="message-sender">AI:</div>}
58
- <MarkdownRenderer markdown={msg.content}/>
59
- </div>
60
- ))}
61
- </div>
62
- );
63
-
64
- const isQuestionEmpty = (input) => input.trim().length === 0;
65
-
66
- const StreamedContent = ({streamedContent}) => (
67
- <div className="message assistant">
68
- <div className="message-sender">AI:</div>
69
- <MarkdownRenderer markdown={streamedContent}/>
70
- </div>
71
- );
72
- const InputContainer = ({question, handleChange, sendPayload, isStreaming, inputTextareaRef}) => (
73
-
74
- <div className="input-container">
75
- <textarea
76
- ref={inputTextareaRef}
77
- value={question}
78
- onChange={handleChange}
79
- placeholder="Enter your question.."
80
- rows={3}
81
- className="input-textarea"
82
- onKeyDown={(event) => {
83
- if (event.key === 'Enter' && !event.shiftKey && !isQuestionEmpty(question)) {
84
- event.preventDefault(); // Prevent the default behavior of adding a new line
85
- sendPayload();
86
- }
87
- }}
88
- />
89
- <button onClick={sendPayload} disabled={isStreaming || isQuestionEmpty(question)} className="send-button">
90
- {isStreaming ? `Sending..` : `Send`}
91
- </button>
92
- </div>
93
- );
94
-
95
- const MarkdownRenderer = ({markdown}) => {
96
- const renderMarkdown = () => {
97
- const html = marked.parse(markdown);
98
- return {__html: html};
99
- };
100
-
101
- return <div dangerouslySetInnerHTML={renderMarkdown()}/>;
102
- };
103
-
104
- ReactDOM.render(<App/>, document.getElementById('root'));
static/sendPayload.js DELETED
@@ -1,62 +0,0 @@
1
- async function getApiResponse(messages, question) {
2
- const messageTuples = [];
3
- let tempArray = [];
4
- for (let i = 0; i < messages.length; i++) {
5
- tempArray.push(messages[i].content);
6
- if (tempArray.length === 2) {
7
- messageTuples.push(tempArray);
8
- tempArray = [];
9
- }
10
- }
11
- const response = await fetch('/ziya/stream_log', {
12
- method: 'POST', headers: {'Content-Type': 'application/json'},
13
- body: JSON.stringify({
14
- input: {
15
- chat_history: messageTuples,
16
- question: question,
17
- },
18
- config: {},
19
- }),
20
- });
21
- return response;
22
- }
23
-
24
- const processLine = (line, setStreamedContent) => {
25
- const data = JSON.parse(line.slice(6));
26
- const streamedOutputOp = data.ops.find(
27
- (op) => op.op === 'add' && op.path === '/logs/ChatBedrock/streamed_output_str/-'
28
- );
29
-
30
- if (streamedOutputOp) {
31
- setStreamedContent((prevContent) => prevContent + streamedOutputOp.value);
32
- }
33
- };
34
-
35
- window.sendPayload = async (messages, question, setStreamedContent, setIsStreaming) => {
36
- try {
37
- const response = await getApiResponse(messages, question);
38
- const reader = response.body.getReader();
39
-
40
- const processData = async ({done, value}) => {
41
- if (done) {
42
- setIsStreaming(false);
43
- return;
44
- }
45
- let buffer = '';
46
- buffer += new TextDecoder('utf-8').decode(value);
47
- const lines = buffer.split('\n');
48
- buffer = lines.pop() || '';
49
-
50
- for (const line of lines) {
51
- if (line.startsWith('data: ')) {
52
- processLine(line, setStreamedContent);
53
- }
54
- }
55
- await reader.read().then(processData);
56
- };
57
- await reader.read().then(processData);
58
- } catch (error) {
59
- console.error(error);
60
- setIsStreaming(false);
61
- }
62
- };
static/ziya.css DELETED
@@ -1,88 +0,0 @@
1
- /* General Styles */
2
- body {
3
- font-family: Arial, sans-serif;
4
- margin: 0;
5
- padding: 0;
6
- background-color: #f5f5f5;
7
- }
8
-
9
- .container {
10
- max-width: 800px;
11
- margin: 0 auto;
12
- padding: 20px;
13
- background-color: #fff;
14
- border-radius: 8px;
15
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
16
- }
17
-
18
- /* Chat Container */
19
- .chat-container {
20
- height: fit-content;
21
- overflow-y: scroll;
22
- padding: 10px;
23
- border: 1px solid #ccc;
24
- border-radius: 4px;
25
- margin: 20px 0;
26
- }
27
-
28
- .message {
29
- padding: 10px;
30
- border-radius: 8px;
31
- }
32
-
33
- .message.human {
34
- background-color: #efefef;
35
- align-self: flex-start;
36
- margin-right: auto;
37
- }
38
-
39
- .message.ai {
40
- background-color: #f0f0f0;
41
- align-self: flex-end;
42
- margin-left: auto;
43
- }
44
-
45
- .message-sender {
46
- font-weight: bold;
47
- margin-bottom: 5px;
48
- }
49
-
50
- /* Input Container */
51
- .input-container {
52
- display: flex;
53
- align-items: center;
54
- }
55
-
56
- .input-textarea {
57
- flex-grow: 1;
58
- padding: 10px;
59
- border: 1px solid #ccc;
60
- border-radius: 4px;
61
- resize: none;
62
- font-size: 16px;
63
- }
64
-
65
- .send-button {
66
- margin-left: 10px;
67
- padding: 10px 20px;
68
- background-color: #007bff;
69
- color: #fff;
70
- border: none;
71
- border-radius: 4px;
72
- cursor: pointer;
73
- font-size: 16px;
74
- }
75
-
76
- .send-button:disabled {
77
- background-color: #ccc;
78
- cursor: not-allowed;
79
- }
80
-
81
- /* Streamed Content */
82
- .streamed-content {
83
- margin-top: 20px;
84
- padding: 10px;
85
- border: 1px solid #ccc;
86
- border-radius: 4px;
87
- background-color: #f0f0f0;
88
- }
@@ -1,24 +0,0 @@
1
- app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- app/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- app/agents/agent.py,sha256=R_dlvm9r40sVh9jK6nJOrq-FElU5fsbx7EkhVR94rXM,4382
4
- app/agents/prompts.py,sha256=O54rH2KupyY7ZSjPEvm3j9DSGjdL3jJOz8F9PTcePQQ,1674
5
- app/main.py,sha256=DHY_hRbnGAsILHac8uJWdJJAg-9HGr6Dl6A27RnBfK4,3146
6
- app/server.py,sha256=YTEHYUsFQhgkGRHZ_y7K3Ju3SmUIbVxLSdgrgi1BuEU,676
7
- app/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- app/utils/directory_util.py,sha256=fdYumUhLcmbaGI0OvGY13CkQSKxrCZi6ZNwhz9_oJmQ,2512
9
- app/utils/gitignore_parser.py,sha256=ksAAvXr8_GFh94cvOdkLmES5k3xxNxW2_tQuQtialIA,7496
10
- app/utils/langchain_validation_util.py,sha256=RgmKayKMApvUA7SPF_DrBAcYdIzzLUVJfnOwTSc1Eug,527
11
- app/utils/logging_utils.py,sha256=8JEcc1t7L-a0G4HLmM8zFydNNSOd5l2-gkTxviLQUns,280
12
- app/utils/print_tree_util.py,sha256=O4Rb-GS8UODxfH7Z6bZGsr-opG6QLmvdaU1im5kh4IA,1419
13
- app/utils/version_util.py,sha256=NcvMWIImJDcO9K5OMX6jJD4q6Zb8Y117Mu8sWIkhxEc,631
14
- pyproject.toml,sha256=NsirFkgp946bh69g1qe7BWSUoAr2gch1KIUet2vEHjk,716
15
- static/app.js,sha256=qz2F0e5LxuVFI3MXWvcON9l1cN0J_ODdQOwbgT3ZqWA,3622
16
- static/favicon.ico,sha256=HgB8xAZdDHFK2lODUsp2H_Dds_i14pnpydx7NEJrNrU,15086
17
- static/sendPayload.js,sha256=VnypSWF7t8bv83026LGU3GMyr9tMrp05hmWATcbCG4k,1956
18
- static/ziya.css,sha256=OaieSXw_7LOk0WNNi-1mPsAaS3rOxhHycKFgFDoiZB0,1395
19
- templates/index.html,sha256=8auy9lGLdcDzBkzpjYB1ygrAVbXpo0rqQ8p1FgMEeck,800
20
- ziya-0.1.7.dist-info/LICENSE,sha256=8CfErGEG13yY1Z-CDlIhAQawX2KOv-QI_2Ge2z6x8SU,1064
21
- ziya-0.1.7.dist-info/METADATA,sha256=tZMxTcj-MPm3HVk4jgp3jKrB5ip7iqwMNKTCQK0hhkM,2921
22
- ziya-0.1.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
23
- ziya-0.1.7.dist-info/entry_points.txt,sha256=1HspxMqCYRli3SqM6CqmT6gsW_G14G4ab3sHlrYUCAA,38
24
- ziya-0.1.7.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- ziya=app.main:main
3
-
File without changes
File without changes
File without changes