quantalogic 0.2.23__py3-none-any.whl → 0.2.24__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.
quantalogic/main.py CHANGED
@@ -8,6 +8,7 @@ from typing import Optional
8
8
 
9
9
  # Third-party imports
10
10
  import click
11
+ import requests
11
12
  from loguru import logger
12
13
 
13
14
  from quantalogic.console_print_events import console_print_events
@@ -119,17 +120,27 @@ def switch_verbose(verbose_mode: bool, log_level: str = "info") -> None:
119
120
  set_litellm_verbose(verbose_mode)
120
121
 
121
122
 
122
- def get_task_from_file(file_path: str) -> str:
123
- """Get task content from specified file."""
123
+ def get_task_from_file(source: str):
124
+ """Get task content from specified file path or URL."""
124
125
  try:
125
- with open(file_path, encoding="utf-8") as f:
126
+ # Check if source is a URL
127
+ if source.startswith(('http://', 'https://')):
128
+ import requests
129
+ response = requests.get(source, timeout=10)
130
+ response.raise_for_status() # Raise an exception for bad status codes
131
+ return response.text.strip()
132
+
133
+ # If not a URL, treat as a local file path
134
+ with open(source, encoding="utf-8") as f:
126
135
  return f.read().strip()
127
136
  except FileNotFoundError:
128
- raise FileNotFoundError(f"Error: File '{file_path}' not found.")
137
+ raise FileNotFoundError(f"Error: File '{source}' not found.")
129
138
  except PermissionError:
130
- raise PermissionError(f"Error: Permission denied when reading '{file_path}'.")
139
+ raise PermissionError(f"Error: Permission denied when reading '{source}'.")
140
+ except requests.exceptions.RequestException as e:
141
+ raise Exception(f"Error retrieving URL content: {e}")
131
142
  except Exception as e:
132
- raise Exception(f"Unexpected error reading file: {e}")
143
+ raise Exception(f"Unexpected error: {e}")
133
144
 
134
145
 
135
146
  # Spinner control
@@ -261,7 +272,7 @@ def cli(
261
272
 
262
273
 
263
274
  @cli.command()
264
- @click.option("--file", type=click.Path(exists=True), help="Path to task file.")
275
+ @click.option("--file", type=str, help="Path to task file or URL.")
265
276
  @click.option(
266
277
  "--model-name",
267
278
  default=MODEL_NAME,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quantalogic
3
- Version: 0.2.23
3
+ Version: 0.2.24
4
4
  Summary: QuantaLogic ReAct Agents
5
5
  Author: Raphaël MANSUY
6
6
  Author-email: raphael.mansuy@gmail.com
@@ -32,6 +32,7 @@ Requires-Dist: pathspec (>=0.12.1,<0.13.0)
32
32
  Requires-Dist: prompt-toolkit (>=3.0.48,<4.0.0)
33
33
  Requires-Dist: pydantic (>=2.10.4,<3.0.0)
34
34
  Requires-Dist: pymdown-extensions (>=10.3.1,<11.0.0)
35
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
35
36
  Requires-Dist: rich (>=13.9.4,<14.0.0)
36
37
  Requires-Dist: serpapi (>=0.1.5,<0.2.0)
37
38
  Requires-Dist: tenacity (>=9.0.0,<10.0.0)
@@ -8,7 +8,7 @@ quantalogic/docs_cli.py,sha256=3giVbUpespB9ZdTSJ955A3BhcOaBl5Lwsn1AVy9XAeY,1663
8
8
  quantalogic/event_emitter.py,sha256=jqot2g4JRXc88K6PW837Oqxbf7shZfO-xdPaUWmzupk,7901
9
9
  quantalogic/generative_model.py,sha256=vv7fvkZz3GRvtuhYGeq64bJUhxyjmhbz-G5mDbsvCiE,15451
10
10
  quantalogic/interactive_text_editor.py,sha256=kYeTA2qej5kxtPvAUHy_Dr2MhrGQAyenLFpW9mU9Rmw,6855
11
- quantalogic/main.py,sha256=9jymO-5P0lFlMVTRRaZde1jO9aeZtwRipH2qQbS91BQ,16777
11
+ quantalogic/main.py,sha256=aD9x-UEutcjOUou_r4pJUZZ4VxP-0J3-NC6eCZxK4og,17234
12
12
  quantalogic/memory.py,sha256=zbtRuM05jaS2lJll-92dt5JfYVLERnF_m_9xqp2x-k0,6304
13
13
  quantalogic/model_names.py,sha256=UZlz25zG9B2dpfwdw_e1Gw5qFsKQ7iME9FJh9Ts4u6s,938
14
14
  quantalogic/prompts.py,sha256=CW4CRgW1hTpXeWdeJNbPaRPUeUm-xKuGHJrT8mOtvkw,3602
@@ -73,8 +73,8 @@ quantalogic/utils/read_http_text_content.py,sha256=n3IayT5KcqctIVVF2gOQQAMf3Ow6e
73
73
  quantalogic/version.py,sha256=ea_cRutaQk5_lwlLbUUvPFuOT7Of7-gAsDl7wdveS-g,107
74
74
  quantalogic/xml_parser.py,sha256=uMLQNHTRCg116FwcjRoquZmSwVtE4LEH-6V2E3RD-dA,11466
75
75
  quantalogic/xml_tool_parser.py,sha256=Vz4LEgDbelJynD1siLOVkJ3gLlfHsUk65_gCwbYJyGc,3784
76
- quantalogic-0.2.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
77
- quantalogic-0.2.23.dist-info/METADATA,sha256=RL78oJwIbWXJuTTEgt6blHokOqiDpX6G3SdCy3i-ZFk,20174
78
- quantalogic-0.2.23.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
79
- quantalogic-0.2.23.dist-info/entry_points.txt,sha256=h74O_Q3qBRCrDR99qvwB4BpBGzASPUIjCfxHq6Qnups,183
80
- quantalogic-0.2.23.dist-info/RECORD,,
76
+ quantalogic-0.2.24.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
77
+ quantalogic-0.2.24.dist-info/METADATA,sha256=7KW6YE5DLHVHhxJDT240XjpJIBe0mhdlIC6lIx58kt8,20216
78
+ quantalogic-0.2.24.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
79
+ quantalogic-0.2.24.dist-info/entry_points.txt,sha256=h74O_Q3qBRCrDR99qvwB4BpBGzASPUIjCfxHq6Qnups,183
80
+ quantalogic-0.2.24.dist-info/RECORD,,