quantalogic 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.
quantalogic/main.py CHANGED
@@ -51,17 +51,27 @@ def create_agent_for_mode(mode: str, model_name: str) -> Agent:
51
51
  raise ValueError(f"Unknown agent mode: {mode}")
52
52
 
53
53
 
54
- def switch_verbose(verbose_mode: bool) -> None:
54
+ def configure_logger(log_level: str) -> None:
55
+ """Configure the logger with the specified log level and format."""
56
+ logger.remove()
57
+ logger.add(sys.stderr, level=log_level.upper(), format="{time} | {level} | {message}")
58
+ logger.info(f"Log level set to: {log_level}")
59
+
60
+
61
+ def set_litellm_verbose(verbose_mode: bool) -> None:
62
+ """Set the verbosity of the litellm library."""
55
63
  import litellm
64
+ litellm.set_verbose = verbose_mode
56
65
 
57
- if verbose_mode:
58
- logger.add(sys.stderr, level="DEBUG", format="{time} | {level} | {message}")
59
- logger.info("Verbose mode enabled.")
66
+
67
+ def switch_verbose(verbose_mode: bool, log_level: str = "info") -> None:
68
+ """Switch verbose mode and configure logger and litellm verbosity."""
69
+ if log_level == "debug":
70
+ configure_logger("DEBUG")
60
71
  else:
61
- logger.info("Verbose mode disabled.")
62
- logger.remove()
72
+ configure_logger(log_level)
63
73
 
64
- litellm.set_verbose = verbose_mode
74
+ set_litellm_verbose(verbose_mode)
65
75
 
66
76
 
67
77
  def get_task_from_file(file_path: str) -> str:
@@ -103,15 +113,23 @@ def display_welcome_message(console: Console, model_name: str) -> None:
103
113
 
104
114
  @click.group(invoke_without_command=True)
105
115
  @click.option("--version", is_flag=True, help="Show version information.")
116
+ @click.option(
117
+ "--model-name",
118
+ default=MODEL_NAME,
119
+ help='Specify the model to use (litellm format, e.g. "openrouter/deepseek-chat").',
120
+ )
121
+ @click.option("--log", type=click.Choice(["info", "debug", "warning"]), default="info", help="Set logging level (info/debug/warning).")
122
+ @click.option("--verbose", is_flag=True, help="Enable verbose output.")
123
+ @click.option("--mode", type=click.Choice(AGENT_MODES), default="code", help="Agent mode (code/search/full).")
106
124
  @click.pass_context
107
- def cli(ctx: click.Context, version: bool) -> None:
125
+ def cli(ctx: click.Context, version: bool, model_name: str, verbose: bool, mode: str, log: str) -> None:
108
126
  """QuantaLogic AI Assistant - A powerful AI tool for various tasks."""
109
127
  if version:
110
128
  console = Console()
111
129
  console.print(f"QuantaLogic version: {get_version()}")
112
130
  sys.exit(0)
113
131
  if ctx.invoked_subcommand is None:
114
- ctx.invoke(task)
132
+ ctx.invoke(task, model_name=model_name, verbose=verbose, mode=mode, log=log)
115
133
 
116
134
 
117
135
  @cli.command()
@@ -123,11 +141,12 @@ def cli(ctx: click.Context, version: bool) -> None:
123
141
  )
124
142
  @click.option("--verbose", is_flag=True, help="Enable verbose output.")
125
143
  @click.option("--mode", type=click.Choice(AGENT_MODES), default="code", help="Agent mode (code/search/full).")
144
+ @click.option("--log", type=click.Choice(["info", "debug", "warning"]), default="info", help="Set logging level (info/debug/warning).")
126
145
  @click.argument("task", required=False)
127
- def task(file: Optional[str], model_name: str, verbose: bool, mode: str, task: Optional[str]) -> None:
146
+ def task(file: Optional[str], model_name: str, verbose: bool, mode: str, log: str, task: Optional[str]) -> None:
128
147
  """Execute a task with the QuantaLogic AI Assistant."""
129
148
  console = Console()
130
- switch_verbose(verbose)
149
+ switch_verbose(verbose, log)
131
150
 
132
151
  try:
133
152
  if file:
quantalogic/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.7"
3
3
  def get_version() -> str:
4
4
  return VERSION
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quantalogic
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: QuantaLogic ReAct Agents
5
5
  Author: Raphaël MANSUY
6
6
  Author-email: raphael.mansuy@gmail.com
@@ -249,6 +249,21 @@ quantalogic \
249
249
  --verbose
250
250
  ```
251
251
 
252
+ ## 📖 Examples
253
+
254
+ Here are some practical examples to help you get started:
255
+
256
+ Here is the markdown table based on the provided directory listing:
257
+
258
+ | Example | Description | File |
259
+ |---------|-------------|------|
260
+ | Simple Agent | A basic example of an agent implementation. | [examples/01-simple-agent.py](examples/01-simple-agent.py) |
261
+ | Agent with Event Monitoring | An example of an agent with event monitoring capabilities. | [examples/02-agent-with-event-monitoring.py](examples/02-agent-with-event-monitoring.py) |
262
+ | Agent with Interpreter | An example of an agent that includes an interpreter. | [examples/03-agent-with-interpreter.py](examples/03-agent-with-interpreter.py) |
263
+ | Agent Summary Task | An example of an agent performing a summary task. | [examples/04-agent-summary-task.py](examples/04-agent-summary-task.py) |
264
+ | Code Example | A general code example. | [examples/05-code.py](examples/05-code.py) |
265
+
266
+
252
267
  ## 🔨 Key Components
253
268
 
254
269
  ### Agent System
@@ -5,7 +5,7 @@ quantalogic/coding_agent.py,sha256=ivHBn3hIDEt9V1LDXI4l-COeGXYVp_v_rrx9ng8sP2A,3
5
5
  quantalogic/event_emitter.py,sha256=jqot2g4JRXc88K6PW837Oqxbf7shZfO-xdPaUWmzupk,7901
6
6
  quantalogic/generative_model.py,sha256=JkZz7YBd-v9n5EURidKUddkCLNvNZaqMzo5PgE_ugmc,8398
7
7
  quantalogic/interactive_text_editor.py,sha256=kYeTA2qej5kxtPvAUHy_Dr2MhrGQAyenLFpW9mU9Rmw,6855
8
- quantalogic/main.py,sha256=PvSf_V-BSQpFSCKSgDIB6DaUCab8ECDd0QWgnWbw0Js,7564
8
+ quantalogic/main.py,sha256=_oLhXNTDSH7Zfc1__jPgOvqZGpYH5VSjamdLwZ4xqDM,8698
9
9
  quantalogic/memory.py,sha256=zbtRuM05jaS2lJll-92dt5JfYVLERnF_m_9xqp2x-k0,6304
10
10
  quantalogic/model_names.py,sha256=UZlz25zG9B2dpfwdw_e1Gw5qFsKQ7iME9FJh9Ts4u6s,938
11
11
  quantalogic/print_event.py,sha256=-4qZmFI2BTkXuGE9DoKm6Vs-GzK1F9WJGt9GqpRQlQQ,2175
@@ -59,11 +59,11 @@ quantalogic/utils/get_quantalogic_rules_content.py,sha256=fnEFTyClXzpI0MLaM-gB9R
59
59
  quantalogic/utils/git_ls.py,sha256=_aXg2TwqYv9CoOrhQ1gqHCqu1j8wOVigQNWbGncSDlM,4361
60
60
  quantalogic/utils/read_file.py,sha256=tSRVHk8dIP4nNLL89v5kRki4hOTjVyjbmuEb2zwvwCY,2077
61
61
  quantalogic/utils/read_http_text_content.py,sha256=1nRLQ9DHP_fKrm0rIEJBF0ROmB78e4lct2hUzD2PAUk,4408
62
- quantalogic/version.py,sha256=vMuwvVglZoPE5da2Fx1uBnrcvAZEF1ZLVbYUA_oU0Jg,64
62
+ quantalogic/version.py,sha256=cmBOpn-_Sn2W6KXKm4ddDDrE_Mt5T2SugB67M1BWIHE,64
63
63
  quantalogic/xml_parser.py,sha256=cTRorr5sVfkIzH72M0C-GQ9ROGPiz2FTT66U9ndjzhE,9538
64
64
  quantalogic/xml_tool_parser.py,sha256=lsVzClZBrZan7wjCuCKnGHWzksXI3VMy_vWthxu2_bo,3738
65
- quantalogic-0.2.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
- quantalogic-0.2.5.dist-info/METADATA,sha256=SH8tnUP8q8Gq2tlcCmgyYrFkdrtPRd4b91dGH2kHljg,38601
67
- quantalogic-0.2.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
68
- quantalogic-0.2.5.dist-info/entry_points.txt,sha256=wgSq5SRU98yvlRHGEZD1Xn7sS5CSjH2RfUtTa6Qy28Q,52
69
- quantalogic-0.2.5.dist-info/RECORD,,
65
+ quantalogic-0.2.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
+ quantalogic-0.2.7.dist-info/METADATA,sha256=y4BAaYJvKp089lLnUwWaKmOR3HuXQrtCHnGzx4gYjG0,39522
67
+ quantalogic-0.2.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
68
+ quantalogic-0.2.7.dist-info/entry_points.txt,sha256=wgSq5SRU98yvlRHGEZD1Xn7sS5CSjH2RfUtTa6Qy28Q,52
69
+ quantalogic-0.2.7.dist-info/RECORD,,