quantalogic 0.2.3__py3-none-any.whl → 0.2.4__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
@@ -21,12 +21,6 @@ from quantalogic.utils.ask_user_validation import console_ask_for_user_validatio
21
21
  from quantalogic.xml_parser import ToleranceXMLParser
22
22
  from quantalogic.xml_tool_parser import ToolParser
23
23
 
24
- # Configure logger based on environment variable
25
- log_level = os.getenv("LOG_LEVEL", "ERROR")
26
- logger.remove()
27
- logger.add(sys.stderr, level=log_level)
28
-
29
-
30
24
  # Maximum ratio occupancy of the occupied memory
31
25
  MAX_OCCUPANCY = 90.0
32
26
 
@@ -81,7 +75,7 @@ class Agent(BaseModel):
81
75
 
82
76
  def __init__(
83
77
  self,
84
- model_name: str = "ollama/qwen2.5-coder:14b",
78
+ model_name: str = "",
85
79
  memory: AgentMemory = AgentMemory(),
86
80
  tools: list[Tool] = [TaskCompleteTool()],
87
81
  ask_for_user_validation: Callable[[str], bool] = console_ask_for_user_validation,
@@ -91,6 +85,7 @@ class Agent(BaseModel):
91
85
  ):
92
86
  """Initialize the agent with model, memory, tools, and configurations."""
93
87
  try:
88
+ logger.debug("Initializing agent...")
94
89
  # Add TaskCompleteTool to the tools list if not already present
95
90
  if TaskCompleteTool() not in tools:
96
91
  tools.append(TaskCompleteTool())
@@ -119,7 +114,7 @@ class Agent(BaseModel):
119
114
  task_to_solve=task_to_solve,
120
115
  specific_expertise=specific_expertise,
121
116
  )
122
- logger.info("Agent initialized successfully.")
117
+ logger.debug("Agent initialized successfully.")
123
118
  except Exception as e:
124
119
  logger.error(f"Failed to initialize agent: {str(e)}")
125
120
  raise
@@ -135,6 +130,7 @@ class Agent(BaseModel):
135
130
  Returns:
136
131
  str: The final response after task completion.
137
132
  """
133
+ logger.debug(f"Solving task... {task}")
138
134
  self._reset_session(task_to_solve=task, max_iterations=max_iterations)
139
135
 
140
136
  # Add system prompt to memory
@@ -215,10 +211,13 @@ class Agent(BaseModel):
215
211
  # Emit event: Task Solve End
216
212
  self._emit_event("task_solve_end")
217
213
 
214
+ logger.debug(f"Task solved: {answer}")
215
+
218
216
  return answer
219
217
 
220
218
  def _reset_session(self, task_to_solve: str = "", max_iterations: int = 30):
221
219
  """Reset the agent's session."""
220
+ logger.debug("Resetting session...")
222
221
  self.task_to_solve = task_to_solve
223
222
  self.memory.reset()
224
223
  self.variable_store.reset()
quantalogic/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
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.3
3
+ Version: 0.2.4
4
4
  Summary: QuantaLogic ReAct Agents
5
5
  Author: Raphaël MANSUY
6
6
  Author-email: raphael.mansuy@gmail.com
@@ -1,5 +1,5 @@
1
1
  quantalogic/__init__.py,sha256=HFk7_19UzHzYwvPzb9QTQ4w_lPwTTPda61AYb8qggZY,686
2
- quantalogic/agent.py,sha256=TzSnVWatyAcfIPo-hESubB-0nlhr82-7fIneajaIG3M,25179
2
+ quantalogic/agent.py,sha256=pvXwJepJMRvkn5DX01b2R77mBSpfQI57mi81s4SN0xY,25196
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
@@ -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=drydBT0J_qpHkpmCE8_x46mY98FpK0zY8R1huMWdpA4,64
62
+ quantalogic/version.py,sha256=H_M9VsTe7G2HeD8XedH6FDu8L351L1RYdBHbbXQpNL8,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.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
- quantalogic-0.2.3.dist-info/METADATA,sha256=Vy2jq-b-nWZmFDYZFNjmemwaC9b2tEjKoftgCRV1H5k,38601
67
- quantalogic-0.2.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
68
- quantalogic-0.2.3.dist-info/entry_points.txt,sha256=wgSq5SRU98yvlRHGEZD1Xn7sS5CSjH2RfUtTa6Qy28Q,52
69
- quantalogic-0.2.3.dist-info/RECORD,,
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,,