From 99ecd6259ad9aaf3ca7a64aadde42b6dc976e6a2 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Thu, 23 Jan 2025 11:53:45 -0500 Subject: removed old files to get code into txt --- extract_code.py | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 extract_code.py (limited to 'extract_code.py') 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}") -- cgit v1.2.3-70-g09d2