MCPcopy
hub / github.com/PromtEngineer/localGPT / main

Function main

rag_system/main.py:318–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316 start_server()
317
318def main():
319 if len(sys.argv) < 2:
320 print("Usage: python main.py [index|chat|show_graph|api] [query]")
321 return
322
323 command = sys.argv[1]
324 if command == "index":
325 # Allow passing file paths from the command line
326 files = sys.argv[2:] if len(sys.argv) > 2 else None
327 run_indexing(files)
328 elif command == "chat":
329 if len(sys.argv) < 3:
330 print("Usage: python main.py chat <query>")
331 return
332 query = " ".join(sys.argv[2:])
333 # 🆕 Print the result for command-line usage
334 print(run_chat(query))
335 elif command == "show_graph":
336 show_graph()
337 elif command == "api":
338 run_api_server()
339 else:
340 print(f"Unknown command: {command}")
341
342if __name__ == "__main__":
343 # This allows running the script from the command line to index documents.

Callers

nothing calls this directly

Calls 4

run_indexingFunction · 0.85
run_chatFunction · 0.85
show_graphFunction · 0.85
run_api_serverFunction · 0.85

Tested by

no test coverage detected