langroid 0.10.1__py3-none-any.whl → 0.10.2__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.
langroid/agent/base.py CHANGED
@@ -150,7 +150,6 @@ class Agent(ABC):
150
150
  show_start_response=noop_fn,
151
151
  )
152
152
  Agent.init_state(self)
153
- self.init_state()
154
153
 
155
154
  def init_state(self) -> None:
156
155
  """Initialize all state vars. Called by Task.run() if restart is True"""
@@ -118,7 +118,7 @@ class ChatAgent(Agent):
118
118
  self.config: ChatAgentConfig = config
119
119
  self.config._set_fn_or_tools(self._fn_call_available())
120
120
  self.message_history: List[LLMMessage] = []
121
- self.tool_instructions_added: bool = False
121
+ self.init_state()
122
122
  # An agent's "task" is defined by a system msg and an optional user msg;
123
123
  # These are "priming" messages that kick off the agent's conversation.
124
124
  self.system_message: str = self.config.system_message
@@ -172,6 +172,15 @@ class ChatAgent(Agent):
172
172
  self.enable_message(SendTool, use=False, handle=True)
173
173
  self.enable_message(AgentSendTool, use=False, handle=True)
174
174
 
175
+ def init_state(self) -> None:
176
+ """
177
+ Initialize the state of the agent. Just conversation state here,
178
+ but subclasses can override this to initialize other state.
179
+ """
180
+ super().init_state()
181
+ self.clear_history(0)
182
+ self.clear_dialog()
183
+
175
184
  @staticmethod
176
185
  def from_id(id: str) -> "ChatAgent":
177
186
  """
@@ -169,6 +169,7 @@ class QueryPlanCritic(ChatAgent):
169
169
  self.enable_message(AgentDoneTool, use=False, handle=True)
170
170
 
171
171
  def init_state(self) -> None:
172
+ super().init_state()
172
173
  self.expecting_feedback_tool = False
173
174
 
174
175
  def query_plan_answer(self, msg: QueryPlanAnswerTool) -> str:
@@ -144,6 +144,7 @@ class LanceQueryPlanAgent(ChatAgent):
144
144
  self.enable_message(AgentDoneTool, use=False, handle=True)
145
145
 
146
146
  def init_state(self) -> None:
147
+ super().init_state()
147
148
  self.curr_query_plan: QueryPlan | None = None
148
149
  self.expecting_query_plan: bool = False
149
150
  # how many times re-trying query plan in response to feedback:
langroid/agent/task.py CHANGED
@@ -259,8 +259,7 @@ class Task:
259
259
  agent = cast(ChatAgent, agent)
260
260
  self.agent: ChatAgent = agent
261
261
  if isinstance(agent, ChatAgent) and len(agent.message_history) == 0 or restart:
262
- self.agent.clear_history(0)
263
- self.agent.clear_dialog()
262
+ self.agent.init_state()
264
263
  # possibly change the system and user messages
265
264
  if system_message:
266
265
  # we always have at least 1 task_message
@@ -579,8 +578,6 @@ class Task:
579
578
  Recursively reset message history & state of own agent and
580
579
  those of all sub-tasks.
581
580
  """
582
- self.agent.clear_history(0)
583
- self.agent.clear_dialog()
584
581
  self.agent.init_state()
585
582
  for t in self.sub_tasks:
586
583
  t.reset_all_sub_tasks()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langroid
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: Harness LLMs with Multi-Agent Programming
5
5
  License: MIT
6
6
  Author: Prasad Chalasani
@@ -1,10 +1,10 @@
1
1
  langroid/__init__.py,sha256=z_fCOLQJPOw3LLRPBlFB5-2HyCjpPgQa4m4iY5Fvb8Y,1800
2
2
  langroid/agent/__init__.py,sha256=CFjjVvXVEV4ac0PdNPHVQHREV2HbbHCF6wj42v5MpJ4,826
3
- langroid/agent/base.py,sha256=mb24KgKsNuX_7nvNHuTCQPcnsVV4-4PqC0EKV01qcqg,59232
3
+ langroid/agent/base.py,sha256=PAMTnYefsDiXBXrj-b9XuBBxj8woqssxOf_0HeXiZsE,59206
4
4
  langroid/agent/batch.py,sha256=feRA_yRG768ElOQjrKEefcRv6Aefd_yY7qktuYUQDwc,10040
5
5
  langroid/agent/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  langroid/agent/callbacks/chainlit.py,sha256=Qedk1-CBCgo9PdaIa7AboLBFCTgAMg9q5nGmoqpZ378,22050
7
- langroid/agent/chat_agent.py,sha256=q39Taek6yhinGWDYP7Uze6p8jP5v5nvn-Y1k-yJB8TQ,48116
7
+ langroid/agent/chat_agent.py,sha256=nGikT3OYQsB4avePxBo4QCY3HV_BJpIItwR_ebOySE8,48378
8
8
  langroid/agent/chat_document.py,sha256=DnmRLma0zud0XsN_wm-F0fnQv3fjQghv3t8Ahudq238,16799
9
9
  langroid/agent/helpers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  langroid/agent/junk,sha256=LxfuuW7Cijsg0szAzT81OjWWv1PMNI-6w_-DspVIO2s,339
@@ -13,9 +13,9 @@ langroid/agent/special/__init__.py,sha256=gik_Xtm_zV7U9s30Mn8UX3Gyuy4jTjQe9zjiE3
13
13
  langroid/agent/special/doc_chat_agent.py,sha256=8NPAhMnHkFUolQ8EHos40tz5Vwuz_m33NjUfjheXWXY,54569
14
14
  langroid/agent/special/lance_doc_chat_agent.py,sha256=s8xoRs0gGaFtDYFUSIRchsgDVbS5Q3C2b2mr3V1Fd-Q,10419
15
15
  langroid/agent/special/lance_rag/__init__.py,sha256=QTbs0IVE2ZgDg8JJy1zN97rUUg4uEPH7SLGctFNumk4,174
16
- langroid/agent/special/lance_rag/critic_agent.py,sha256=lRHLBU9TWo4ixm_wEPUP9bCjW0iSIw7ZRe6u4D4v7jk,9519
16
+ langroid/agent/special/lance_rag/critic_agent.py,sha256=OtFuHthKQLkdVkvuZ2m0GNq1qOYLqHkm1pfLRFnSg5c,9548
17
17
  langroid/agent/special/lance_rag/lance_rag_task.py,sha256=qDouwz-Yi8aSIAVb2Jx6buTKwO2L7PSvUY604Eu0uIM,2957
18
- langroid/agent/special/lance_rag/query_planner_agent.py,sha256=-ZKareApPQD0EbwB1ABeZdhYAA2lJbwSVkfSuhMcKMk,11480
18
+ langroid/agent/special/lance_rag/query_planner_agent.py,sha256=5YPeliCjlRk1LEDe5eFyqfkq9RjDfa4usjBsNmT9GsQ,11509
19
19
  langroid/agent/special/lance_tools.py,sha256=qS8x4wi8mrqfbYV2ztFzrcxyhHQ0ZWOc-zkYiH7awj0,2105
20
20
  langroid/agent/special/neo4j/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  langroid/agent/special/neo4j/csv_kg_chat.py,sha256=dRsAgMBa1H_EMI2YYgJR2Xyv1D7e4o3G9M64mTewq_c,6409
@@ -33,7 +33,7 @@ langroid/agent/special/sql/utils/system_message.py,sha256=qKLHkvQWRQodTtPLPxr1GS
33
33
  langroid/agent/special/sql/utils/tools.py,sha256=vFYysk6Vi7HJjII8B4RitA3pt_z3gkSglDNdhNVMiFc,1332
34
34
  langroid/agent/special/table_chat_agent.py,sha256=d9v2wsblaRx7oMnKhLV7uO_ujvk9gh59pSGvBXyeyNc,9659
35
35
  langroid/agent/structured_message.py,sha256=y7pud1EgRNeTFZlJmBkLmwME3yQJ_IYik-Xds9kdZbY,282
36
- langroid/agent/task.py,sha256=y4FXXLSJv_8LIox4-E48MG_VQl1558WCLR9w35-KBJ4,80560
36
+ langroid/agent/task.py,sha256=3Shs5PFDTrKgbt6kyYyyHXIDc0V9z8wCubwCWKcuvmU,80448
37
37
  langroid/agent/tool_message.py,sha256=OiShCp8NwG7p3fVxwLhHCxhaRp2chuzEL7FBWOqoxg4,11715
38
38
  langroid/agent/tools/__init__.py,sha256=lgWAWsPgMx-NdDPVX6tXO_U0cIQX7dwzhUC0G4IfUgk,726
39
39
  langroid/agent/tools/duckduckgo_search_tool.py,sha256=NhsCaGZkdv28nja7yveAhSK_w6l_Ftym8agbrdzqgfo,1935
@@ -134,8 +134,8 @@ langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3Hmh
134
134
  langroid/vector_store/momento.py,sha256=qR-zBF1RKVHQZPZQYW_7g-XpTwr46p8HJuYPCkfJbM4,10534
135
135
  langroid/vector_store/qdrant_cloud.py,sha256=3im4Mip0QXLkR6wiqVsjV1QvhSElfxdFSuDKddBDQ-4,188
136
136
  langroid/vector_store/qdrantdb.py,sha256=v88lqFkepADvlN6lByUj9I4NEKa9X9lWH16uTPPbYrE,17457
137
- pyproject.toml,sha256=21iGX12213VuyH8F3VPPMSnMQVCozYwNpBrpESXVN70,7088
138
- langroid-0.10.1.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
139
- langroid-0.10.1.dist-info/METADATA,sha256=0KuuhuEIzCzwo1ySmkGGL6pepOTwBADkmVR6NNzh9Pg,54992
140
- langroid-0.10.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
141
- langroid-0.10.1.dist-info/RECORD,,
137
+ pyproject.toml,sha256=pfB7YUZ95hBPldXjKSFUJcyE2smbS67EpJx-glYg20U,7106
138
+ langroid-0.10.2.dist-info/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
139
+ langroid-0.10.2.dist-info/METADATA,sha256=kKD4a_WwpLHCOffm6vwnHpOcWEgL64uDePVAd2ku83Q,54992
140
+ langroid-0.10.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
141
+ langroid-0.10.2.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "langroid"
3
- version = "0.10.1"
3
+ version = "0.10.2"
4
4
  description = "Harness LLMs with Multi-Agent Programming"
5
5
  authors = ["Prasad Chalasani <pchalasani@gmail.com>"]
6
6
  readme = "README.md"
@@ -90,6 +90,7 @@ async-generator = "^1.10"
90
90
  python-magic = "^0.4.27"
91
91
  json-repair = "^0.27.0"
92
92
 
93
+
93
94
  [tool.poetry.extras]
94
95
  # install these using, e.g.,
95
96
  # `poetry install -E [...]` where [...] is one of the extras below
@@ -169,14 +170,14 @@ optional = true
169
170
 
170
171
  mkdocs = "^1.4.2"
171
172
  mkdocs-material = "^9.1.5"
172
- mkdocstrings = {extras = ["python"], version = "^0.21.2"}
173
+ mkdocstrings = {extras = ["python"], version = "^0.25.2"}
173
174
  mkdocs-awesome-pages-plugin = "^2.8.0"
174
175
  mkdocs-rss-plugin = "^1.8.0"
175
176
  mkdocs-gen-files = "^0.4.0"
176
177
  mkdocs-literate-nav = "^0.6.0"
177
178
  mkdocs-section-index = "^0.3.5"
178
179
  mkdocs-jupyter = "^0.24.1"
179
-
180
+ griffe = "<1.0.0"
180
181
 
181
182
 
182
183
  # ========================================