You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-11
Original file line number
Diff line number
Diff line change
@@ -12,17 +12,17 @@ Cody continuously updates its knowledge base every time you save a file, ensurin
12
12
13
13
## 🚀 Getting Started
14
14
15
-
1.Set the environment variable `OPENAI_API_KEY` in a `.env` file with your OpenAI API key.
16
-
2.Modify the `ignore_list` in the `if __name__ == "__main__":` section of the script to specify directories and files you wish to exclude from monitoring.
17
-
3.Run the script using Python: python codyv4.py or codyv5.py
18
-
19
-
4. Once the script is running, type 'Q' and press enter to switch to question mode. Cody is ready to answer your queries!
15
+
1.Clone the repo
16
+
2.(Optionally) Setup virtual environment by running `pip install -m venv .venv` and then `pip install -r requirements.txt` in terminal from the root of your directory
17
+
3.Rename the `.local.env` file to `.env`` and replace `YOUR_API_KEY_HERE` with your OpenAI API Key.
18
+
4. Modify the `IGNORE_THESE` global var at the top of the script to specify directories and files you wish to exclude from monitoring. (You should comment out any large files like a virtual environment, cache, js libraries you have downloaded, etc...)
19
+
5. Run the script using Python: python cody.py and follow terminal for setup. It will prompt you for if you want to use text chat (terminal) or conversational (speech i/o). It will also warn you if you remove .env from the ignore list.
20
20
21
21
## 🎯 Features
22
22
23
23
-**File Monitoring**: Real-time monitoring of all files in your project's directory and subdirectories. 👀
24
24
-**Embedding-based Knowledge Base**: Create a knowledge base using OpenAI Embeddings. Cody collects the contents of all text and JSON files and adds them to this knowledge base. 📚
25
-
-**Interactive Querying**: Listen to user inputs. Ask questions, and Cody will generate a response using the knowledge base. 🧠
25
+
-**Interactive Q&A**: Listen to user inputs. Ask questions, and Cody will generate a response using the knowledge base. 🧠
26
26
-**Customizable**: Easily specify files or directories to ignore during monitoring.
27
27
28
28
## 🛠 Dependencies
@@ -37,17 +37,16 @@ Cody continuously updates its knowledge base every time you save a file, ensurin
37
37
38
38
## 💡 Usage
39
39
40
-
- For version V4 (Text Interaction), type 'Q' and press enter. Cody will prompt you to input your question. Once you've entered your query, Cody will generate a response based on its knowledge base. Use Cody to debug code, troubleshoot errors, ask for help in adding new features, understand how functions interact across files, and more.
41
-
42
-
- For version V5 (Voice Interaction), simply speak to Cody, and it will respond accordingly. Cody is here to assist you with various programming tasks, making it a valuable tool in your coding journey.
43
-
44
-
To stop the script, type 'exit' or speak the word 'exit' and press enter. Cody will gracefully terminate the program.
40
+
- To stop the script, type 'exit' or speak the word 'exit' and press enter. Cody will gracefully terminate the program.
45
41
46
42
## ⚠️ Notes & Tips
47
43
48
44
- Cody uses the FAISS library for efficient similarity search in storing vectors. Please ensure you have sufficient memory available, especially when monitoring a large number of files.
49
45
- Additionally, be sure to monitor your OpenAI api usage. A helpful tip is to set a monthly spend limit inside of your OpenAI account to prevent anything crazy from happening. As an additional helper, it prints the number of tokens used in each call you make.
50
46
- "LIVE" coding questions. To use to it's full potential. I recommend opening a seperate terminal or even command prompt cd'ing into your project directory, and then launching python cody.py. Then place it split screen with your code in a small viewing window on the far left or right. This way, you can use a seperate terminal for actually running your code without worrying about Cody or having to run him (er... it) each time! This will still continue to update with each file save you do on any file so it always is using the latest data.
51
47
48
+
## Contributing
49
+
50
+
Contributions are welcome. Please submit a pull request or open an issue for any bugs or feature requests.
response=f"You are an expert programmer who is aware of this much of the code base:{str(docs)}. \n"
151
-
response+="Please answer this: "+question+" Keep your answer under 20 words if possible. Speak in bullet points if you can to help with conciseness. Your main priority is to answer their questions using the info provided including line numbers if possible. Also note that when you give answers please include the file path if it makes sense. If the question is not relevant or not a question simply respond with 'Skipping'. Do not include any special text like _'s or ''s as this will be read by text to speech. Only include text in the response without non character letters. Even function names with _ in them should be replaced with a space so it is more readable audibly."
152
-
ai_response=generate_response(response)
153
-
text=""
149
+
ifterminal_input:
150
+
text=input("\U00002753 Please type your question (or 'exit' to quit): ")
0 commit comments