pirag 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {pirag-0.1.1 → pirag-0.1.2}/PKG-INFO +9 -4
  2. {pirag-0.1.1 → pirag-0.1.2}/README.md +8 -3
  3. {pirag-0.1.1 → pirag-0.1.2}/app/main.py +4 -1
  4. {pirag-0.1.1 → pirag-0.1.2}/app/rag/config.py +18 -17
  5. {pirag-0.1.1 → pirag-0.1.2}/app/rag/doctor/config.py +4 -0
  6. {pirag-0.1.1/app/rag/train → pirag-0.1.2/app/rag/doctor}/router.py +3 -0
  7. {pirag-0.1.1 → pirag-0.1.2}/pirag.egg-info/PKG-INFO +9 -4
  8. {pirag-0.1.1 → pirag-0.1.2}/pyproject.toml +1 -1
  9. {pirag-0.1.1 → pirag-0.1.2}/LICENSE +0 -0
  10. {pirag-0.1.1 → pirag-0.1.2}/app/rag/agent.py +0 -0
  11. {pirag-0.1.1 → pirag-0.1.2}/app/rag/ask/__init__.py +0 -0
  12. {pirag-0.1.1 → pirag-0.1.2}/app/rag/ask/config.py +0 -0
  13. {pirag-0.1.1 → pirag-0.1.2}/app/rag/ask/router.py +0 -0
  14. {pirag-0.1.1 → pirag-0.1.2}/app/rag/ask/service.py +0 -0
  15. {pirag-0.1.1 → pirag-0.1.2}/app/rag/doctor/__init__.py +0 -0
  16. {pirag-0.1.1 → pirag-0.1.2}/app/rag/doctor/service.py +0 -0
  17. {pirag-0.1.1 → pirag-0.1.2}/app/rag/test/__init__.py +0 -0
  18. {pirag-0.1.1 → pirag-0.1.2}/app/rag/test/config.py +0 -0
  19. {pirag-0.1.1 → pirag-0.1.2}/app/rag/test/router.py +0 -0
  20. {pirag-0.1.1 → pirag-0.1.2}/app/rag/test/service.py +0 -0
  21. {pirag-0.1.1 → pirag-0.1.2}/app/rag/train/__init__.py +0 -0
  22. {pirag-0.1.1 → pirag-0.1.2}/app/rag/train/config.py +0 -0
  23. {pirag-0.1.1/app/rag/doctor → pirag-0.1.2/app/rag/train}/router.py +0 -0
  24. {pirag-0.1.1 → pirag-0.1.2}/app/rag/train/service.py +0 -0
  25. {pirag-0.1.1 → pirag-0.1.2}/app/requirements.txt +0 -0
  26. {pirag-0.1.1 → pirag-0.1.2}/app/setup.py +0 -0
  27. {pirag-0.1.1 → pirag-0.1.2}/pirag.egg-info/SOURCES.txt +0 -0
  28. {pirag-0.1.1 → pirag-0.1.2}/pirag.egg-info/dependency_links.txt +0 -0
  29. {pirag-0.1.1 → pirag-0.1.2}/pirag.egg-info/entry_points.txt +0 -0
  30. {pirag-0.1.1 → pirag-0.1.2}/pirag.egg-info/requires.txt +0 -0
  31. {pirag-0.1.1 → pirag-0.1.2}/pirag.egg-info/top_level.txt +0 -0
  32. {pirag-0.1.1 → pirag-0.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pirag
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: CLI Projects of On-Premise RAG. You can use your own LLM and vector DB. Or just add remote LLM servers and vector DB.
5
5
  Author-email: semir4in <semir4in@gmail.com>, jyje <jyjeon@outlook.com>
6
6
  Project-URL: Homepage, https://github.com/jyje/pilot-onpremise-rag
@@ -46,15 +46,20 @@ Dynamic: license-file
46
46
  git clone https://github.com/jyje/pilot-onpremise-rag
47
47
  cd pilot-onpremise-rag
48
48
 
49
- docker compose -f docker/compose.yaml up -d
49
+ docker compose -f docker/compose.yaml up
50
50
  ```
51
51
 
52
- ### Install pirag
52
+ ### Install pirag from source
53
53
  ```bash
54
54
  git clone https://github.com/jyje/pilot-onpremise-rag
55
55
  cd pilot-onpremise-rag
56
56
 
57
- pip install --upgrade -e ./app
57
+ pip install --upgrade -e .
58
+ ```
59
+
60
+ ### Install pirag from PyPI
61
+ ```bash
62
+ pip install --upgrade pirag
58
63
  ```
59
64
 
60
65
  ## 📚 Usage
@@ -27,15 +27,20 @@
27
27
  git clone https://github.com/jyje/pilot-onpremise-rag
28
28
  cd pilot-onpremise-rag
29
29
 
30
- docker compose -f docker/compose.yaml up -d
30
+ docker compose -f docker/compose.yaml up
31
31
  ```
32
32
 
33
- ### Install pirag
33
+ ### Install pirag from source
34
34
  ```bash
35
35
  git clone https://github.com/jyje/pilot-onpremise-rag
36
36
  cd pilot-onpremise-rag
37
37
 
38
- pip install --upgrade -e ./app
38
+ pip install --upgrade -e .
39
+ ```
40
+
41
+ ### Install pirag from PyPI
42
+ ```bash
43
+ pip install --upgrade pirag
39
44
  ```
40
45
 
41
46
  ## 📚 Usage
@@ -62,7 +62,10 @@ def main():
62
62
  command_message = f"with command: {args.command}" if args.command else ""
63
63
  logger.info(f"RAG Started {command_message}")
64
64
 
65
- setup_logger(args.log_level)
65
+ setup_logger(
66
+ log_level = args.log_level,
67
+ log_dir = args.log_dir,
68
+ )
66
69
  logger.debug(f"Parsed arguments: {args}")
67
70
 
68
71
  if args.command == 'doctor':
@@ -3,34 +3,35 @@ from pathlib import Path
3
3
  from loguru import logger
4
4
 
5
5
  # Logger format constants
6
- TIME_FORMAT = "{time:YYYY-MM-DD HH:mm:ss.SSS!UTC}Z"
7
- FILE_FORMAT = f"{TIME_FORMAT} | {{level: <8}} | {{name}}:{{function}}:{{line}} - {{message}}"
8
- CONSOLE_FORMAT_FULL = f"<green>{TIME_FORMAT}</green> | <level>{{level: <8}}</level> | <cyan>{{name}}</cyan>:<cyan>{{function}}</cyan>:<cyan>{{line}}</cyan> - <level>{{message}}</level>\n"
9
- CONSOLE_FORMAT_SIMPLE = f"<green>{TIME_FORMAT}</green> | <level>{{level: <8}}</level> | <level>{{message}}</level>\n"
6
+ LOG_TIME_FORMAT = "{time:YYYY-MM-DD HH:mm:ss.SSS!UTC}Z"
7
+ LOG_FILE_FORMAT = f"{LOG_TIME_FORMAT} | {{level: <8}} | {{name}}:{{function}}:{{line}} - {{message}}"
8
+ LOG_CONSOLE_FORMAT_FULL = f"<green>{LOG_TIME_FORMAT}</green> | <level>{{level: <8}}</level> | <cyan>{{name}}</cyan>:<cyan>{{function}}</cyan>:<cyan>{{line}}</cyan> - <level>{{message}}</level>\n"
9
+ LOG_CONSOLE_FORMAT_SIMPLE = f"<green>{LOG_TIME_FORMAT}</green> | <level>{{level: <8}}</level> | <level>{{message}}</level>\n"
10
10
 
11
11
  # Initial logger setup before setup_logger()
12
12
  logger.remove()
13
13
  logger.add(
14
14
  sink = sys.stderr,
15
15
  level = "INFO",
16
- format = lambda record: CONSOLE_FORMAT_SIMPLE if record["level"].name == "INFO" else CONSOLE_FORMAT_FULL,
16
+ format = lambda record: LOG_CONSOLE_FORMAT_SIMPLE if record["level"].name == "INFO" else LOG_CONSOLE_FORMAT_FULL,
17
17
  colorize = True
18
18
  )
19
19
 
20
- def setup_logger(log_level: str):
20
+ def setup_logger(log_level: str, log_dir: str):
21
21
  """Configure logger with specified level and outputs"""
22
22
 
23
- logger.remove()
24
-
25
- log_dir = Path("app/logs")
23
+ log_dir = Path(log_dir)
26
24
  log_dir.mkdir(exist_ok=True, parents=True)
27
25
 
26
+ logger.remove()
27
+
28
28
  # File handler
29
29
  logger.add(
30
- sink = log_dir / "app.log",
30
+ sink = log_dir / "{time:YYYYMMDD-HHmmss!UTC}Z.log",
31
31
  level = log_level,
32
- rotation = "500 MB",
33
- format = FILE_FORMAT,
32
+ rotation = "100 MB",
33
+ retention = 0,
34
+ format = LOG_FILE_FORMAT,
34
35
  serialize = False,
35
36
  enqueue = True,
36
37
  backtrace = True,
@@ -42,7 +43,7 @@ def setup_logger(log_level: str):
42
43
  logger.add(
43
44
  sink = sys.stderr,
44
45
  level = log_level,
45
- format = lambda record: CONSOLE_FORMAT_SIMPLE if record["level"].name == "INFO" else CONSOLE_FORMAT_FULL,
46
+ format = lambda record: LOG_CONSOLE_FORMAT_SIMPLE if record["level"].name == "INFO" else LOG_CONSOLE_FORMAT_FULL,
46
47
  colorize = True
47
48
  )
48
49
 
@@ -133,10 +134,10 @@ top_parser.add_argument(
133
134
  )
134
135
 
135
136
  top_parser.add_argument(
136
- '--log-path',
137
- envvar = 'LOG_PATH',
138
- help = 'Path to log file',
139
- default = '.logs',
137
+ '--log-dir',
138
+ envvar = 'LOG_DIR',
139
+ help = 'Path to log directory',
140
+ default = '.pirag/logs',
140
141
  type = str,
141
142
  required = False,
142
143
  action = EnvDefault,
@@ -1,5 +1,7 @@
1
1
  import argparse
2
2
 
3
+ from app.rag.config import top_parser, common_parser
4
+
3
5
  help = "Diagnose the RAG system."
4
6
 
5
7
  parser = argparse.ArgumentParser(
@@ -17,4 +19,6 @@ subparsers.add_parser(
17
19
  "check",
18
20
  help = "Check RAG System. Scan all components of the system and diagnose status",
19
21
  description = "Check RAG System. Scan all components of the system and diagnose status",
22
+ parents = [top_parser, common_parser],
23
+ add_help = False,
20
24
  )
@@ -1,4 +1,7 @@
1
1
  from argparse import Namespace
2
+ from loguru import logger
2
3
 
3
4
  def route(args: Namespace):
5
+ logger.info("Doctor route")
4
6
  print(args)
7
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pirag
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: CLI Projects of On-Premise RAG. You can use your own LLM and vector DB. Or just add remote LLM servers and vector DB.
5
5
  Author-email: semir4in <semir4in@gmail.com>, jyje <jyjeon@outlook.com>
6
6
  Project-URL: Homepage, https://github.com/jyje/pilot-onpremise-rag
@@ -46,15 +46,20 @@ Dynamic: license-file
46
46
  git clone https://github.com/jyje/pilot-onpremise-rag
47
47
  cd pilot-onpremise-rag
48
48
 
49
- docker compose -f docker/compose.yaml up -d
49
+ docker compose -f docker/compose.yaml up
50
50
  ```
51
51
 
52
- ### Install pirag
52
+ ### Install pirag from source
53
53
  ```bash
54
54
  git clone https://github.com/jyje/pilot-onpremise-rag
55
55
  cd pilot-onpremise-rag
56
56
 
57
- pip install --upgrade -e ./app
57
+ pip install --upgrade -e .
58
+ ```
59
+
60
+ ### Install pirag from PyPI
61
+ ```bash
62
+ pip install --upgrade pirag
58
63
  ```
59
64
 
60
65
  ## 📚 Usage
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pirag"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "CLI Projects of On-Premise RAG. You can use your own LLM and vector DB. Or just add remote LLM servers and vector DB."
5
5
  authors = [
6
6
  { name="semir4in", email="semir4in@gmail.com" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes