diff options
author | A.J. Shulman <Shulman.aj@gmail.com> | 2025-01-23 11:53:45 -0500 |
---|---|---|
committer | A.J. Shulman <Shulman.aj@gmail.com> | 2025-01-23 11:53:45 -0500 |
commit | 99ecd6259ad9aaf3ca7a64aadde42b6dc976e6a2 (patch) | |
tree | 179c0839ca42472d3790425c0d8b8b933f6a06f6 /extract_code.py | |
parent | 99e2a1728b9b97d30f5e0fffe6a10201bdee49c2 (diff) |
removed old files to get code into txt
Diffstat (limited to 'extract_code.py')
-rw-r--r-- | extract_code.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/extract_code.py b/extract_code.py deleted file mode 100644 index 43e0150e2..000000000 --- a/extract_code.py +++ /dev/null @@ -1,39 +0,0 @@ -import os - -# List of files to extract code from, relative to the `src` folder -files = [ - "src/client/views/nodes/chatbot/agentsystem/Agent.ts", - "src/client/views/nodes/chatbot/agentsystem/prompts.ts", - "src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx", - "src/client/views/nodes/chatbot/chatboxcomponents/MessageComponent.tsx", - "src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts", - "src/client/views/nodes/chatbot/response_parsers/StreamedAnswerParser.ts", - "src/client/views/nodes/chatbot/tools/BaseTool.ts", - "src/client/views/nodes/chatbot/tools/CreateAnyDocTool.ts", - "src/client/views/nodes/chatbot/tools/RAGTool.ts", - "src/client/views/nodes/chatbot/tools/SearchTool.ts", - "src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts", - "src/client/views/nodes/chatbot/types/tool_types.ts", - "src/client/views/nodes/chatbot/types/types.ts", - "src/client/views/nodes/chatbot/vectorstore/Vectorstore.ts", -] - -# Output file name -output_file = "extracted_code.txt" - -def extract_and_format_code(file_list, output_path): - with open(output_path, "w") as outfile: - for file in file_list: - # Since the script runs from the chatbot folder, prepend the relative path from chatbot to src - if os.path.exists(file): - with open(file, "r") as infile: - code = infile.read() - # Write formatted code to the output file - outfile.write(f"--- {file} ---\n\n```\n{code}\n```\n\n") - else: - print(f"File not found: {file}") - -# Run the extraction and formatting -extract_and_format_code(files, output_file) - -print(f"Code extracted and saved to {output_file}") |