quantalogic 0.2.4__py3-none-any.whl → 0.2.6__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/agent.py CHANGED
@@ -92,11 +92,14 @@ class Agent(BaseModel):
92
92
 
93
93
  tool_manager = ToolManager(tools={tool.name: tool for tool in tools})
94
94
  environment = get_environment()
95
+ logger.debug(f"Environment details: {environment}")
95
96
  tools_markdown = tool_manager.to_markdown()
97
+ logger.debug(f"Tools Markdown: {tools_markdown}")
96
98
 
97
99
  system_prompt_text = system_prompt(
98
100
  tools=tools_markdown, environment=environment, expertise=specific_expertise
99
101
  )
102
+ logger.debug(f"System prompt: {system_prompt_text}")
100
103
 
101
104
  config = AgentConfig(
102
105
  environment_details=environment,
@@ -104,6 +107,7 @@ class Agent(BaseModel):
104
107
  system_prompt=system_prompt_text,
105
108
  )
106
109
 
110
+ logger.debug("Base class init started ...")
107
111
  super().__init__(
108
112
  model=GenerativeModel(model=model_name),
109
113
  memory=memory,
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()
@@ -124,10 +142,10 @@ def cli(ctx: click.Context, version: bool) -> None:
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).")
126
144
  @click.argument("task", required=False)
127
- def task(file: Optional[str], model_name: str, verbose: bool, mode: str, task: Optional[str]) -> None:
145
+ def task(file: Optional[str], model_name: str, verbose: bool, mode: str, task: Optional[str], log: str) -> None:
128
146
  """Execute a task with the QuantaLogic AI Assistant."""
129
147
  console = Console()
130
- switch_verbose(verbose)
148
+ switch_verbose(verbose, log)
131
149
 
132
150
  try:
133
151
  if file:
quantalogic/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.6"
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.4
3
+ Version: 0.2.6
4
4
  Summary: QuantaLogic ReAct Agents
5
5
  Author: Raphaël MANSUY
6
6
  Author-email: raphael.mansuy@gmail.com
@@ -1,11 +1,11 @@
1
1
  quantalogic/__init__.py,sha256=HFk7_19UzHzYwvPzb9QTQ4w_lPwTTPda61AYb8qggZY,686
2
- quantalogic/agent.py,sha256=pvXwJepJMRvkn5DX01b2R77mBSpfQI57mi81s4SN0xY,25196
2
+ quantalogic/agent.py,sha256=QBQc-C_h_DsstV2ntHETh8XywPAcY31-ThO2SiBqvB0,25443
3
3
  quantalogic/agent_config.py,sha256=sNuZ0Y02h3ra2hcjAE3-8Tt-NE8QSarRsTB0auTLgn0,3595
4
4
  quantalogic/coding_agent.py,sha256=ivHBn3hIDEt9V1LDXI4l-COeGXYVp_v_rrx9ng8sP2A,3214
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=V-CCQ-mIsTF7ADnhbmTSqX0OXoh3ab7VXXNDOfv5KNo,8562
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=H_M9VsTe7G2HeD8XedH6FDu8L351L1RYdBHbbXQpNL8,64
62
+ quantalogic/version.py,sha256=lUJXxcVq879WHOvNf-Ah1y_zO8VPZXvfSfv2nY6eiZc,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.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
- quantalogic-0.2.4.dist-info/METADATA,sha256=d93jsS31zo9A5kTwe3PsSLyvLvwRw_pnIEwC7wziHV8,38601
67
- quantalogic-0.2.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
68
- quantalogic-0.2.4.dist-info/entry_points.txt,sha256=wgSq5SRU98yvlRHGEZD1Xn7sS5CSjH2RfUtTa6Qy28Q,52
69
- quantalogic-0.2.4.dist-info/RECORD,,
65
+ quantalogic-0.2.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
+ quantalogic-0.2.6.dist-info/METADATA,sha256=JRAonJSWnd4RDArz-P0LSyPR0ovaniOqxtOPSkihQFE,38601
67
+ quantalogic-0.2.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
68
+ quantalogic-0.2.6.dist-info/entry_points.txt,sha256=wgSq5SRU98yvlRHGEZD1Xn7sS5CSjH2RfUtTa6Qy28Q,52
69
+ quantalogic-0.2.6.dist-info/RECORD,,