ursa-ai 0.2.5__py3-none-any.whl → 0.2.7__py3-none-any.whl

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.

@@ -7,15 +7,15 @@
7
7
  # - Review the results of the search and identify the source or sources that contain the needed information.
8
8
  # - Summarize the information from multiple sources to identify well-supported or inconsistent information.
9
9
  # - Perform additional searches until you are confident that you have the information that is requested.
10
- # - Summarize the information and provide the sources back to the user.
10
+ # - Summarize the information and provide the sources back to the user.
11
11
  # - If you cannot find the requested information, be honest with the user that the information was unavailable.
12
12
  # """
13
13
 
14
14
  # websearch_prompt = """
15
15
  # You are an experienced researcher tasked with finding accurate, credible, and relevant information online to address the user's request.
16
- #
16
+ #
17
17
  # Before starting your search, ensure you clearly understand the user's request. Perform the following actions:
18
- #
18
+ #
19
19
  # 1. Formulate one or more specific search queries designed to retrieve precise and authoritative information.
20
20
  # 2. Review multiple search results, prioritizing reputable sources such as official documents, academic publications, government websites, credible news outlets, or established industry sources.
21
21
  # 3. Evaluate the quality, reliability, and recency of each source used.
@@ -24,29 +24,29 @@
24
24
  # 6. Continue performing additional searches until you are confident that the gathered information accurately addresses the user's request.
25
25
  # 7. Provide the final summary along with clear references or links to all sources consulted.
26
26
  # 8. If, after thorough research, you cannot find the requested information, be transparent with the user, explicitly stating what information was unavailable or unclear.
27
- #
27
+ #
28
28
  # You may also be given feedback by a critic. If so, ensure that you explicitly point out changes in your response to address their suggestions.
29
- #
29
+ #
30
30
  # Your goal is to deliver a thorough, clear, and trustworthy answer, supported by verifiable sources.
31
31
  # """
32
- #
32
+ #
33
33
  # reflection_prompt = """
34
34
  # You are a quality control supervisor responsible for evaluating the researcher's summary of information gathered in response to a user's query.
35
- #
35
+ #
36
36
  # Carefully assess the researcher’s work according to the following stringent criteria:
37
- #
37
+ #
38
38
  # - **Correctness:** Ensure the results are credible and the researcher documented reliable sources.
39
39
  # - **Completeness:** Ensure the researcher has provided sufficient detail and context to answer the user's query.
40
- #
40
+ #
41
41
  # Provide a structured evaluation:
42
- #
42
+ #
43
43
  # 1. Identify the level of strictness that is required for answering the user's query.
44
44
  # 2. Clearly list any unsupported assumptions or claims lacking proper citation.
45
45
  # 3. Identify any missing information or critical details that should have been included.
46
46
  # 4. Suggest specific actions or additional searches the researcher should undertake if the provided information is incomplete or insufficient.
47
- #
47
+ #
48
48
  # If, after a thorough review, the researcher’s summary fully meets your quality standards (accuracy and completeness), conclude your evaluation with "[APPROVED]".
49
- #
49
+ #
50
50
  # Your primary goal is to ensure rigor, accuracy, and reliability in the information presented to the user.
51
51
  # """
52
52
 
@@ -121,11 +121,11 @@ If it does not, rovide a structured evaluation:
121
121
  Your primary goal is to ensure rigor, accuracy, and reliability in the information presented to the user.
122
122
  """
123
123
 
124
- summarize_prompt = '''
124
+ summarize_prompt = """
125
125
  Your goal is to summarize a long user/critic conversation as they work through a complex problem requiring multiple steps.
126
126
 
127
127
  Your responsibilities is to write a condensed summary of the conversation.
128
128
  - Repeat the solution to the original query.
129
129
  - Identify all important points from the conversation.
130
130
  - Highlight any places where those goals were not achieved and why.
131
- '''
131
+ """
@@ -9,17 +9,20 @@ from rich.text import Text
9
9
  # unified diff hunk header regex
10
10
  _HUNK_RE = re.compile(r"^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@")
11
11
 
12
+
12
13
  @dataclass
13
14
  class _LineStyle:
14
15
  prefix: str
15
16
  bg: str
16
17
 
18
+
17
19
  _STYLE = {
18
20
  "add": _LineStyle("+ ", "on #003000"),
19
21
  "del": _LineStyle("- ", "on #300000"),
20
22
  "ctx": _LineStyle(" ", "on grey15"),
21
23
  }
22
24
 
25
+
23
26
  class DiffRenderer:
24
27
  """Renderable diff—`console.print(DiffRenderer(...))`"""
25
28
 
@@ -64,7 +67,9 @@ class DiffRenderer:
64
67
  indent_ticks = f" {tick_col} {tick_col}"
65
68
  # pad to the indent width
66
69
  full_indent = indent_ticks.ljust(2 * n + 3)
67
- yield Text(f"{full_indent}{raw}".ljust(width), style="white on grey30")
70
+ yield Text(
71
+ f"{full_indent}{raw}".ljust(width), style="white on grey30"
72
+ )
68
73
  continue
69
74
 
70
75
  # skip header lines
@@ -98,7 +103,9 @@ class DiffRenderer:
98
103
  new_str = str(new_num) if new_num is not None else " "
99
104
 
100
105
  # Syntax-highlight the code part
101
- syntax = Syntax(code, self._lexer_name, line_numbers=False, word_wrap=False)
106
+ syntax = Syntax(
107
+ code, self._lexer_name, line_numbers=False, word_wrap=False
108
+ )
102
109
  text_code: Text = syntax.highlight(code)
103
110
  if text_code.plain.endswith("\n"):
104
111
  text_code = text_code[:-1]
@@ -118,4 +125,4 @@ class DiffRenderer:
118
125
  if pad_len > 0:
119
126
  line_text.append(" " * pad_len, style=style.bg)
120
127
 
121
- yield line_text
128
+ yield line_text
@@ -33,7 +33,9 @@ class AgentMemory:
33
33
  collection_name: str = "agent_memory",
34
34
  ) -> None:
35
35
  self.path = (
36
- Path(path) if path else Path(__file__).resolve().parent / "agent_memory_db"
36
+ Path(path)
37
+ if path
38
+ else Path(__file__).resolve().parent / "agent_memory_db"
37
39
  )
38
40
  self.collection_name = collection_name
39
41
  self.path.mkdir(parents=True, exist_ok=True)
@@ -69,7 +71,9 @@ class AgentMemory:
69
71
  Optional metadata dict for each chunk, same length as ``chunks``.
70
72
  """
71
73
  docs = [
72
- Document(page_content=text, metadata=metadatas[i] if metadatas else {})
74
+ Document(
75
+ page_content=text, metadata=metadatas[i] if metadatas else {}
76
+ )
73
77
  for i, text in enumerate(chunks)
74
78
  ]
75
79
 
@@ -107,7 +111,8 @@ class AgentMemory:
107
111
  if len(text) > 0: # only add non-empty documents
108
112
  docs.append(
109
113
  Document(
110
- page_content=text, metadata=metadatas[i] if metadatas else {}
114
+ page_content=text,
115
+ metadata=metadatas[i] if metadatas else {},
111
116
  )
112
117
  )
113
118
  self.vectorstore.add_documents(docs)
@@ -161,9 +166,7 @@ def delete_database(path: Optional[str | Path] = None):
161
166
  ``agent_memory_db`` is created in the package’s base directory.
162
167
  """
163
168
 
164
- db_path = (
165
- Path(path) if path else Path("~/.cache/ursa/rag/db/")
166
- )
169
+ db_path = Path(path) if path else Path("~/.cache/ursa/rag/db/")
167
170
  if os.path.exists(db_path):
168
171
  shutil.rmtree(db_path)
169
172
  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.5
3
+ Version: 0.2.7
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
@@ -42,10 +42,10 @@ Dynamic: license-file
42
42
 
43
43
  # URSA - The Universal Research and Scientific Agent
44
44
 
45
- <img src="./logos/logo.png" alt="URSA Logo" width="200" height="200">
45
+ <img src="https://github.com/lanl/ursa/raw/main/logos/logo.png" alt="URSA Logo" width="200" height="200">
46
46
 
47
47
  [![PyPI Version][pypi-version]](https://pypi.org/project/ursa-ai/)
48
- [![PyPI Downloads][total-downloads]](https://pepy.tech/projects/ursa-ai)
48
+ [![PyPI Downloads][monthly-downloads]](https://pypistats.org/packages/ursa-ai)
49
49
 
50
50
  The flexible agentic workflow for accelerating scientific tasks.
51
51
  Composes information flow between agents for planning, code writing and execution, and online research to solve complex problems.
@@ -115,7 +115,7 @@ You have a duty for ensuring that you use URSA responsibly.
115
115
 
116
116
  URSA has been developed at Los Alamos National Laboratory as part of the ArtIMis project.
117
117
 
118
- <img src="./logos/artimis.png" alt="ArtIMis Logo" width="200" height="200">
118
+ <img src="https://github.com/lanl/ursa/raw/main/logos/artimis.png" alt="ArtIMis Logo" width="200" height="200">
119
119
 
120
120
  ### Notice of Copyright Assertion (O4958):
121
121
  *This program is Open-Source under the BSD-3 License.
@@ -127,4 +127,4 @@ Redistribution and use in source and binary forms, with or without modification,
127
127
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
128
128
 
129
129
  [pypi-version]: https://img.shields.io/pypi/v/ursa-ai?style=flat-square&label=PyPI
130
- [total-downloads]: https://img.shields.io/pepy/dt/ursa-ai?style=flat-square&label=downloads&color=blue
130
+ [monthly-downloads]: https://img.shields.io/pypi/dm/ursa-ai?style=flat-square&label=Downloads&color=blue
@@ -0,0 +1,26 @@
1
+ ursa/agents/__init__.py,sha256=fhuGhYRfOSJ5o2yxjOvdEqJFy2j-VWLDkhiNi3wYNRw,498
2
+ ursa/agents/arxiv_agent.py,sha256=nLZ1huMREr-INSDv1RMmOM8a-DcLBjNBWLSi3oFI5hw,14274
3
+ ursa/agents/base.py,sha256=kGbiGn8qu1eKQSv2Y9YZWEv8ngYsyUMTBkAxk8iD9R0,1334
4
+ ursa/agents/code_review_agent.py,sha256=yVO7nzYI3o0k2HguFw3OSY1IrCy5W8V0YiriYAeviY4,11562
5
+ ursa/agents/execution_agent.py,sha256=Hw7EZem8qYedXjeLi5RDPrPIhqlW1G-vE66MlZ7g1BY,16607
6
+ ursa/agents/hypothesizer_agent.py,sha256=p3bLHyqsiGRwYS4nycYcwnpye2j1umWdaOYspGAFRU0,23309
7
+ ursa/agents/mp_agent.py,sha256=Kv793S2x6gavdgBD68wxvTPNFKLDLyI0FSs8iXCkcVQ,9732
8
+ ursa/agents/planning_agent.py,sha256=5KSRk_gDsUrv_6zSxd7CqXhhMCYtnlfNlxSI9tSbqzc,5422
9
+ ursa/agents/recall_agent.py,sha256=UcNRZLbx3j3cHaLEZul4__KzWV4SnUhLTjX9GeoYbHM,823
10
+ ursa/agents/websearch_agent.py,sha256=zDS4IF-WJgsvSmV42HEO582rt3zCh_fJjteh7VpSNe4,7715
11
+ ursa/prompt_library/code_review_prompts.py,sha256=-HuhwW9W_p2LDn44bXLntxLADHCOyl-2KIXxRHto66w,2444
12
+ ursa/prompt_library/execution_prompts.py,sha256=JBBmzVV0605uwFXNv0pxH0fXHqtmOgcDzabjpq3wt2A,2153
13
+ ursa/prompt_library/hypothesizer_prompts.py,sha256=is1SpCbsUtsYsyWOFz3H6M4nCnfyOMPj2p0mOcaEucc,763
14
+ ursa/prompt_library/literature_prompts.py,sha256=zhBiN3Q-1Z2hp-hkXXp0T8Ipc-6YUM9gw85DjNu1F6I,421
15
+ ursa/prompt_library/planning_prompts.py,sha256=C8IfVc3ny_5-03bJZop2Yax7wfqS_UIdUGsTZSNQRC0,3534
16
+ ursa/prompt_library/websearch_prompts.py,sha256=n4DJaYn_lIYAVtdy00CCJjT-dLWhn2JNipYqMJAotdY,8846
17
+ ursa/tools/run_command.py,sha256=sQRuHtRyJYWEyL9dpW_Ukc-xQ5vmKKJK1i_6z3uKEfA,690
18
+ ursa/tools/write_code.py,sha256=DtCsUMZegYm0mk-HMPG5Zo3Ba1gbGfnXHsv1NZTdDs8,1220
19
+ ursa/util/diff_renderer.py,sha256=gHawyUtBLeOq32A25_etDSy-HXAPyZQrnzfYGtHoEIQ,4086
20
+ ursa/util/memory_logger.py,sha256=Qu8JRjqvXvchnVh6s-91te_xnfOAK1fJDyf1DvsRWnI,5737
21
+ ursa/util/parse.py,sha256=M0cjyQWmjatxX4WbVmDRUiirTLyW-t_Aemlrlrsc5nA,2811
22
+ ursa_ai-0.2.7.dist-info/licenses/LICENSE,sha256=4Vr6_u2zTHIUvYjoOBg9ztDbfpV3hyCFv3mTCS87gYU,1482
23
+ ursa_ai-0.2.7.dist-info/METADATA,sha256=93ph0QLYscdrN2SpPVlEVjVtUaxDBpIE2BYMyTTJAkY,6848
24
+ ursa_ai-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ ursa_ai-0.2.7.dist-info/top_level.txt,sha256=OjA1gRYSUAeiXGnpqPC8iOOGfcjFO1IlP848qMnYSdY,5
26
+ ursa_ai-0.2.7.dist-info/RECORD,,
@@ -1,26 +0,0 @@
1
- ursa/agents/__init__.py,sha256=J2GVc4GpQwNHvzxePgjtAHgz806ZGrSPJs3QyOPHFlA,616
2
- ursa/agents/arxiv_agent.py,sha256=1w3Mu8iK3vhP1zWCtqnuMQ5CQ74H6oy6RPWJPBkLC_o,13151
3
- ursa/agents/base.py,sha256=4wHwXPAcmH_Ml3SG-E4aJwcMVkNPAG9MBbKTWpCQVsc,1337
4
- ursa/agents/code_review_agent.py,sha256=0qTTeTgYSM0n1Z7nPtDKP7790Ea9bm9Jg2E4w8jLDC8,11376
5
- ursa/agents/execution_agent.py,sha256=NoEsT4Y9wpMU0rceQP9RUhmBFBjPfjy6zp0hgiQXnQA,16468
6
- ursa/agents/hypothesizer_agent.py,sha256=FQwLKUKsoV-yw9dS8Tync1fy1Tw84VCx4zThX_SJH8I,23210
7
- ursa/agents/mp_agent.py,sha256=qMosIZncfCqsNNNHsShc0paq2bH_gzrHZiaEf_a6j-8,9220
8
- ursa/agents/planning_agent.py,sha256=CdXNgH4VDvdcrgtwtydvvZOeV5DPLDkX24I_iWYBAew,5192
9
- ursa/agents/recall_agent.py,sha256=wtUf3tkcyUAdhQ8gNV_mLeXBoAhFV-RDZ20EMTweXSw,836
10
- ursa/agents/websearch_agent.py,sha256=_JlTPSeA_UY2nwMaiiYBDWzvcgoys_RWBfNIUWMfbr8,7117
11
- ursa/prompt_library/code_review_prompts.py,sha256=6hI158aIJ4LPxuwuGHSsqj3AIngpJVez05twPQSCFaw,2442
12
- ursa/prompt_library/execution_prompts.py,sha256=hDmvSZzGcmza4DP1Z-yDVAJCTcvQ-sgz8bQxBAVqaeg,2153
13
- ursa/prompt_library/hypothesizer_prompts.py,sha256=is1SpCbsUtsYsyWOFz3H6M4nCnfyOMPj2p0mOcaEucc,763
14
- ursa/prompt_library/literature_prompts.py,sha256=xUteIC6Cf8CvKFNKy_YxViiJBK1ldYu2Y18BNOWOZ68,420
15
- ursa/prompt_library/planning_prompts.py,sha256=SvvKbPU29yHnM4dLyNu12Z8OrBIjFWc_jUPAtsEtJOA,3536
16
- ursa/prompt_library/websearch_prompts.py,sha256=Dyu26-o-QpUjo_m4Uj7mE_SXzLxPueT8P-yXI1s3RZU,8858
17
- ursa/tools/run_command.py,sha256=sQRuHtRyJYWEyL9dpW_Ukc-xQ5vmKKJK1i_6z3uKEfA,690
18
- ursa/tools/write_code.py,sha256=DtCsUMZegYm0mk-HMPG5Zo3Ba1gbGfnXHsv1NZTdDs8,1220
19
- ursa/util/diff_renderer.py,sha256=efiXAd6Lz1-4QSNNX4_yYSK4xEInnmWUENXqg7emOPg,4014
20
- ursa/util/memory_logger.py,sha256=Prnqs-ZJDiCVGzsKAxBK5NUUOGCrzE9mGPKjz7adRFY,5674
21
- ursa/util/parse.py,sha256=M0cjyQWmjatxX4WbVmDRUiirTLyW-t_Aemlrlrsc5nA,2811
22
- ursa_ai-0.2.5.dist-info/licenses/LICENSE,sha256=4Vr6_u2zTHIUvYjoOBg9ztDbfpV3hyCFv3mTCS87gYU,1482
23
- ursa_ai-0.2.5.dist-info/METADATA,sha256=2q2rVeCTs4907XF2os0yuda-59iEzvVb2Kt7p0X1P88,6768
24
- ursa_ai-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- ursa_ai-0.2.5.dist-info/top_level.txt,sha256=OjA1gRYSUAeiXGnpqPC8iOOGfcjFO1IlP848qMnYSdY,5
26
- ursa_ai-0.2.5.dist-info/RECORD,,