ursa-ai 0.2.10__tar.gz → 0.2.11__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.

Potentially problematic release.


This version of ursa-ai might be problematic. Click here for more details.

Files changed (31) hide show
  1. {ursa_ai-0.2.10/src/ursa_ai.egg-info → ursa_ai-0.2.11}/PKG-INFO +1 -1
  2. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/util/memory_logger.py +17 -8
  3. {ursa_ai-0.2.10 → ursa_ai-0.2.11/src/ursa_ai.egg-info}/PKG-INFO +1 -1
  4. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/LICENSE +0 -0
  5. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/README.md +0 -0
  6. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/pyproject.toml +0 -0
  7. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/setup.cfg +0 -0
  8. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/__init__.py +0 -0
  9. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/arxiv_agent.py +0 -0
  10. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/base.py +0 -0
  11. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/code_review_agent.py +0 -0
  12. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/execution_agent.py +0 -0
  13. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/hypothesizer_agent.py +0 -0
  14. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/mp_agent.py +0 -0
  15. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/planning_agent.py +0 -0
  16. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/recall_agent.py +0 -0
  17. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/agents/websearch_agent.py +0 -0
  18. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/prompt_library/code_review_prompts.py +0 -0
  19. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/prompt_library/execution_prompts.py +0 -0
  20. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/prompt_library/hypothesizer_prompts.py +0 -0
  21. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/prompt_library/literature_prompts.py +0 -0
  22. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/prompt_library/planning_prompts.py +0 -0
  23. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/prompt_library/websearch_prompts.py +0 -0
  24. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/tools/run_command.py +0 -0
  25. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/tools/write_code.py +0 -0
  26. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/util/diff_renderer.py +0 -0
  27. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa/util/parse.py +0 -0
  28. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa_ai.egg-info/SOURCES.txt +0 -0
  29. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa_ai.egg-info/dependency_links.txt +0 -0
  30. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa_ai.egg-info/requires.txt +0 -0
  31. {ursa_ai-0.2.10 → ursa_ai-0.2.11}/src/ursa_ai.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ursa-ai
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Agents for science at LANL
5
5
  Author-email: Mike Grosskopf <mikegros@lanl.gov>, Nathan Debardeleben <ndebard@lanl.gov>, Rahul Somasundaram <rsomasundaram@lanl.gov>, Isaac Michaud <imichaud@lanl.gov>, Avanish Mishra <avanish@lanl.gov>, Arthur Lui <alui@lanl.gov>, Russell Bent <rbent@lanl.gov>, Earl Lawrence <earl@lanl.gov>
6
6
  License-Expression: BSD-3-Clause
@@ -26,20 +26,30 @@ class AgentMemory:
26
26
  * Requires `langchain-chroma`, and `chromadb`.
27
27
  """
28
28
 
29
+ @classmethod
30
+ def get_db_path(cls, path: Optional[str | Path]) -> Path:
31
+ match path:
32
+ case None:
33
+ return Path.home() / ".cache" / "ursa" / "rag" / "db"
34
+ case str():
35
+ return Path(str)
36
+ case Path():
37
+ return path
38
+ case _:
39
+ raise TypeError(
40
+ f"Type of path is `{type(path)}` "
41
+ "but `Optional[str | Path]` was expected."
42
+ )
43
+
29
44
  def __init__(
30
45
  self,
31
46
  embedding_model,
32
47
  path: Optional[str | Path] = None,
33
48
  collection_name: str = "agent_memory",
34
49
  ) -> None:
35
- self.path = (
36
- Path(path)
37
- if path
38
- else Path(__file__).resolve().parent / "agent_memory_db"
39
- )
50
+ self.path = self.get_db_path(path)
40
51
  self.collection_name = collection_name
41
52
  self.path.mkdir(parents=True, exist_ok=True)
42
-
43
53
  self.embeddings = embedding_model
44
54
 
45
55
  # If a DB already exists, load it; otherwise defer creation until `build_index`.
@@ -165,8 +175,7 @@ def delete_database(path: Optional[str | Path] = None):
165
175
  Where the on-disk Chroma DB is for deleting. If *None*, a folder called
166
176
  ``agent_memory_db`` is created in the package’s base directory.
167
177
  """
168
-
169
- db_path = Path(path) if path else Path("~/.cache/ursa/rag/db/")
178
+ db_path = AgentMemory.get_db_path(path)
170
179
  if os.path.exists(db_path):
171
180
  shutil.rmtree(db_path)
172
181
  print(f"Database: {db_path} has been deleted.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ursa-ai
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Agents for science at LANL
5
5
  Author-email: Mike Grosskopf <mikegros@lanl.gov>, Nathan Debardeleben <ndebard@lanl.gov>, Rahul Somasundaram <rsomasundaram@lanl.gov>, Isaac Michaud <imichaud@lanl.gov>, Avanish Mishra <avanish@lanl.gov>, Arthur Lui <alui@lanl.gov>, Russell Bent <rbent@lanl.gov>, Earl Lawrence <earl@lanl.gov>
6
6
  License-Expression: BSD-3-Clause
File without changes
File without changes
File without changes
File without changes