ziya 0.1.8__py3-none-any.whl → 0.1.10__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.cb757d14.js +3 -0
  15. templates/static/js/main.cb757d14.js.LICENSE.txt +39 -0
  16. templates/static/js/main.cb757d14.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.8.dist-info → ziya-0.1.10.dist-info}/METADATA +2 -1
  26. ziya-0.1.10.dist-info/RECORD +37 -0
  27. ziya-0.1.10.dist-info/entry_points.txt +7 -0
  28. static/app.js +0 -158
  29. static/sendPayload.js +0 -62
  30. static/ziya.css +0 -88
  31. ziya-0.1.8.dist-info/RECORD +0 -24
  32. ziya-0.1.8.dist-info/entry_points.txt +0 -3
  33. {static → templates}/favicon.ico +0 -0
  34. {ziya-0.1.8.dist-info → ziya-0.1.10.dist-info}/LICENSE +0 -0
  35. {ziya-0.1.8.dist-info → ziya-0.1.10.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ziya
3
- Version: 0.1.8
3
+ Version: 0.1.10
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=QeEwwfbMOTdufUDk0CgGYy-5ooN2VJ2B8OzXNGn39To,804
15
+ scripts.py,sha256=70BOvYoboMhl3Bxjy73m1ozmI8UV8JZVyi2RwUptkK8,809
16
+ templates/.DS_Store,sha256=IWzGxsqGRcdoSHwV5Q9YF26GaZGnTClZWzKJgx33UyY,6148
17
+ templates/asset-manifest.json,sha256=xmLIPc4q5-e2jxV_215ip96RKZm1qfv5tmmDH0W2vPM,1157
18
+ templates/favicon.ico,sha256=HgB8xAZdDHFK2lODUsp2H_Dds_i14pnpydx7NEJrNrU,15086
19
+ templates/index.html,sha256=QZxJitzArN1iZ4KNN-OiGY4im9nUyFeKyvL_HB6eEgw,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.cb757d14.js,sha256=Cmg2Gp_5Amx-lRJSFDANzNyh66cpHF7wYXnuTh1IQyU,191487
23
+ templates/static/js/main.cb757d14.js.LICENSE.txt,sha256=vIOq_0PT75MBMxu_6qzE0thUnfyQKfeGvWq90yNjsCA,971
24
+ templates/static/js/main.cb757d14.js.map,sha256=2yMLDpTQOshgpdyRJQuzgmcOBjw-R1AF_f1bumF6Z2U,481409
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.10.dist-info/LICENSE,sha256=8CfErGEG13yY1Z-CDlIhAQawX2KOv-QI_2Ge2z6x8SU,1064
34
+ ziya-0.1.10.dist-info/METADATA,sha256=Ra6ZvM_3g-m9Lr7KS0mOHIcW2k1BApBr6yboPVJHQdw,2978
35
+ ziya-0.1.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ ziya-0.1.10.dist-info/entry_points.txt,sha256=6-KUolj5XXeOPVCJGTJgUL_3lDVGxG-YtK5BTvFPyBg,147
37
+ ziya-0.1.10.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,158 +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 (msgs, msg) => {
17
- setQuestion('');
18
- setIsStreaming(true);
19
- setMessages((messages) => [...msgs, {content: msg, role: 'human'}]);
20
- setStreamedContent('');
21
- await window.sendPayload(messages, msg, 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(messages, question)}
41
- isStreaming={isStreaming}
42
- />
43
- {streamedContent || messages.length > 0 ? <div className="chat-container">
44
- {streamedContent && <StreamedContent streamedContent={streamedContent}/>}
45
- {messages.length > 0 &&
46
- <ChatContainer messages={messages} setMessages={setMessages}
47
- handleSendPayload={handleSendPayload}/>}
48
- </div> : null}
49
-
50
- </div>
51
- </div>
52
- );
53
- };
54
-
55
- const EditButton = ({message, index, setMessages, handleSendPayload}) => {
56
- const [isEditing, setIsEditing] = useState(false);
57
- const [editedMessage, setEditedMessage] = useState(message.content);
58
-
59
- const handleEdit = () => {
60
- setIsEditing(true);
61
- };
62
-
63
- const handleCancel = () => {
64
- setIsEditing(false);
65
- setEditedMessage(message.content);
66
- };
67
-
68
- const handleSubmit = () => {
69
- setIsEditing(false);
70
- setMessages((prevMessages) => {
71
- const updatedMessages = [...prevMessages];
72
- updatedMessages.splice(index);
73
- handleSendPayload(updatedMessages, editedMessage);
74
- return updatedMessages;
75
- });
76
- };
77
-
78
- return (
79
- <div>
80
- {isEditing ? (
81
- <>
82
- <textarea
83
- value={editedMessage}
84
- onChange={(e) => setEditedMessage(e.target.value)}
85
- />
86
- <button onClick={handleSubmit}>Submit</button>
87
- <button onClick={handleCancel}>Cancel</button>
88
- </>
89
- ) : (
90
- <button className="edit-button" onClick={handleEdit}>Edit</button>
91
- )}
92
- </div>
93
- );
94
- };
95
- const ChatContainer = ({messages, setMessages, handleSendPayload}) => (
96
- <div>
97
- {messages.slice().reverse().map((msg, index) => (
98
- <div key={index} className={`message ${msg.role}`}>
99
- {msg.role === 'human' ? (
100
- <div style={{display: 'flex', justifyContent: 'space-between'}}>
101
- <div className="message-sender">You:</div>
102
- <EditButton
103
- message={msg}
104
- index={messages.length - 1 - index}
105
- setMessages={setMessages}
106
- handleSendPayload={handleSendPayload}
107
- />
108
- </div>
109
- ) : (
110
- <div className="message-sender">AI:</div>
111
- )}
112
- <MarkdownRenderer markdown={msg.content}/>
113
- </div>
114
- ))}
115
- </div>
116
- );
117
-
118
- const isQuestionEmpty = (input) => input.trim().length === 0;
119
-
120
- const StreamedContent = ({streamedContent}) => (
121
- <div className="message assistant">
122
- <div className="message-sender">AI:</div>
123
- <MarkdownRenderer markdown={streamedContent}/>
124
- </div>
125
- );
126
- const InputContainer = ({question, handleChange, sendPayload, isStreaming, inputTextareaRef}) => (
127
-
128
- <div className="input-container">
129
- <textarea
130
- ref={inputTextareaRef}
131
- value={question}
132
- onChange={handleChange}
133
- placeholder="Enter your question.."
134
- rows={3}
135
- className="input-textarea"
136
- onKeyDown={(event) => {
137
- if (event.key === 'Enter' && !event.shiftKey && !isQuestionEmpty(question)) {
138
- event.preventDefault(); // Prevent the default behavior of adding a new line
139
- sendPayload();
140
- }
141
- }}
142
- />
143
- <button onClick={sendPayload} disabled={isStreaming || isQuestionEmpty(question)} className="send-button">
144
- {isStreaming ? `Sending..` : `Send`}
145
- </button>
146
- </div>
147
- );
148
-
149
- const MarkdownRenderer = ({markdown}) => {
150
- const renderMarkdown = () => {
151
- const html = marked.parse(markdown);
152
- return {__html: html};
153
- };
154
-
155
- return <div dangerouslySetInnerHTML={renderMarkdown()}/>;
156
- };
157
-
158
- 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=jXsQJf7Tt_VYxssmnTZyv8Bmy_u1Cn4SAjfwfA2wxLQ,716
15
- static/app.js,sha256=E5O8rtrB1N2bjjKR9SwBbxy5ro8MawzEMU4JUeT-9W4,5513
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.8.dist-info/LICENSE,sha256=8CfErGEG13yY1Z-CDlIhAQawX2KOv-QI_2Ge2z6x8SU,1064
21
- ziya-0.1.8.dist-info/METADATA,sha256=kkIQo33M-WwZChmNQFxkiBStVNMOA5YwWEUiPTPjbP4,2921
22
- ziya-0.1.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
23
- ziya-0.1.8.dist-info/entry_points.txt,sha256=1HspxMqCYRli3SqM6CqmT6gsW_G14G4ab3sHlrYUCAA,38
24
- ziya-0.1.8.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