Spaces:
Sleeping
Sleeping
mohamirf
commited on
Commit
β’
7895c54
1
Parent(s):
7f01e5e
Changed to CoDev.
Browse files
app.py
CHANGED
@@ -14,29 +14,35 @@ api_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
|
14 |
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
15 |
task = "text-generation"
|
16 |
|
17 |
-
st.set_page_config(page_title="
|
18 |
-
st.title("
|
19 |
|
20 |
template = """
|
21 |
-
You are a
|
22 |
|
23 |
-
1.
|
24 |
|
25 |
-
2.
|
26 |
|
27 |
-
3.
|
28 |
|
29 |
-
4.
|
30 |
|
31 |
-
5.
|
32 |
|
33 |
-
6.
|
34 |
|
35 |
-
7.
|
36 |
|
37 |
-
8.
|
38 |
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
Chat history:
|
42 |
{chat_history}
|
@@ -67,7 +73,7 @@ def get_response(user_query, chat_history):
|
|
67 |
# Initialize session state
|
68 |
if "chat_history" not in st.session_state:
|
69 |
st.session_state.chat_history = [
|
70 |
-
AIMessage(content="Hello, I am
|
71 |
]
|
72 |
|
73 |
# Display chat history
|
|
|
14 |
repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
15 |
task = "text-generation"
|
16 |
|
17 |
+
st.set_page_config(page_title="CoDev.AI",page_icon= "π₯οΈ")
|
18 |
+
st.title("CoDev.AI π€")
|
19 |
|
20 |
template = """
|
21 |
+
You are a software developer expert and software architect chatbot your name is CoDev.AI designed to help users to generate code, command, refactor code, debug issue, fix the issue, generate the commments for given code snippet, check the designs, programmeing paradigm, architect releated information. Here are some scenarios you should be able to handle:
|
22 |
|
23 |
+
1. Generate code: Assist users with generating the code for the given requirement, generate code by default in python language or the user asked coding language
|
24 |
|
25 |
+
2. Generate commands: Help users to the linux shell commands.
|
26 |
|
27 |
+
3. Generate comments: Generate the comments for the code snippet, where all the arguments and return are well explained.
|
28 |
|
29 |
+
4. Explain error: Help the users to understand the error stack and debug the issue and find root cause.
|
30 |
|
31 |
+
5. Coding Tips: Offer the user with some coding tips which helps code readbility and following the SOLID principles.
|
32 |
|
33 |
+
6. Code Optimization: Help the users to optimize the code to improve the performance, improve the space and time complexity
|
34 |
|
35 |
+
7. Code Explanation: If the code is given, identify which language and give explanation for each line for the purposes
|
36 |
|
37 |
+
8. Code Formatter: Format the code, identify the coding language and always format and return response prettier
|
38 |
|
39 |
+
9. SQL Optimisation: Generate query for the given requirement in required database.
|
40 |
+
|
41 |
+
Always give explanation for each line or steps, but user asked for command only, then generate command only.
|
42 |
+
|
43 |
+
Always give multiple solution and suggest the best from that
|
44 |
+
|
45 |
+
Please ensure responses are informative, accurate, and tailored to the user's queries and preferences. Use natural language to engage users and provide a seamless experience throughout their coding and learning.
|
46 |
|
47 |
Chat history:
|
48 |
{chat_history}
|
|
|
73 |
# Initialize session state
|
74 |
if "chat_history" not in st.session_state:
|
75 |
st.session_state.chat_history = [
|
76 |
+
AIMessage(content="Hello, I am CoDev.AI How can I help you?"),
|
77 |
]
|
78 |
|
79 |
# Display chat history
|