letta-client 0.1.49__py3-none-any.whl → 0.1.51__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.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

@@ -25,7 +25,7 @@ class BlocksClient:
25
25
  self, agent_id: str, block_label: str, *, request_options: typing.Optional[RequestOptions] = None
26
26
  ) -> Block:
27
27
  """
28
- Retrieve a memory block from an agent.
28
+ Retrieve a core memory block from an agent.
29
29
 
30
30
  Parameters
31
31
  ----------
@@ -97,7 +97,7 @@ class BlocksClient:
97
97
  request_options: typing.Optional[RequestOptions] = None,
98
98
  ) -> Block:
99
99
  """
100
- Updates a memory block of an agent.
100
+ Updates a core memory block of an agent.
101
101
 
102
102
  Parameters
103
103
  ----------
@@ -187,7 +187,7 @@ class BlocksClient:
187
187
 
188
188
  def list(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Block]:
189
189
  """
190
- Retrieve the memory blocks of a specific agent.
190
+ Retrieve the core memory blocks of a specific agent.
191
191
 
192
192
  Parameters
193
193
  ----------
@@ -245,7 +245,7 @@ class BlocksClient:
245
245
  self, agent_id: str, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
246
246
  ) -> AgentState:
247
247
  """
248
- Attach a block to an agent.
248
+ Attach a core memoryblock to an agent.
249
249
 
250
250
  Parameters
251
251
  ----------
@@ -306,7 +306,7 @@ class BlocksClient:
306
306
  self, agent_id: str, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
307
307
  ) -> AgentState:
308
308
  """
309
- Detach a block from an agent.
309
+ Detach a core memory block from an agent.
310
310
 
311
311
  Parameters
312
312
  ----------
@@ -372,7 +372,7 @@ class AsyncBlocksClient:
372
372
  self, agent_id: str, block_label: str, *, request_options: typing.Optional[RequestOptions] = None
373
373
  ) -> Block:
374
374
  """
375
- Retrieve a memory block from an agent.
375
+ Retrieve a core memory block from an agent.
376
376
 
377
377
  Parameters
378
378
  ----------
@@ -452,7 +452,7 @@ class AsyncBlocksClient:
452
452
  request_options: typing.Optional[RequestOptions] = None,
453
453
  ) -> Block:
454
454
  """
455
- Updates a memory block of an agent.
455
+ Updates a core memory block of an agent.
456
456
 
457
457
  Parameters
458
458
  ----------
@@ -552,7 +552,7 @@ class AsyncBlocksClient:
552
552
  self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
553
553
  ) -> typing.List[Block]:
554
554
  """
555
- Retrieve the memory blocks of a specific agent.
555
+ Retrieve the core memory blocks of a specific agent.
556
556
 
557
557
  Parameters
558
558
  ----------
@@ -618,7 +618,7 @@ class AsyncBlocksClient:
618
618
  self, agent_id: str, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
619
619
  ) -> AgentState:
620
620
  """
621
- Attach a block to an agent.
621
+ Attach a core memoryblock to an agent.
622
622
 
623
623
  Parameters
624
624
  ----------
@@ -687,7 +687,7 @@ class AsyncBlocksClient:
687
687
  self, agent_id: str, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
688
688
  ) -> AgentState:
689
689
  """
690
- Detach a block from an agent.
690
+ Detach a core memory block from an agent.
691
691
 
692
692
  Parameters
693
693
  ----------
@@ -27,6 +27,8 @@ from ..types.message_create import MessageCreate
27
27
  from ..core.serialization import convert_and_respect_annotation_metadata
28
28
  from ..core.jsonable_encoder import jsonable_encoder
29
29
  from .types.update_agent_tool_rules_item import UpdateAgentToolRulesItem
30
+ import datetime as dt
31
+ from ..types.passage import Passage
30
32
  from .types.agents_search_request_search_item import AgentsSearchRequestSearchItem
31
33
  from .types.agents_search_response import AgentsSearchResponse
32
34
  from ..core.client_wrapper import AsyncClientWrapper
@@ -689,6 +691,145 @@ class AgentsClient:
689
691
  raise ApiError(status_code=_response.status_code, body=_response.text)
690
692
  raise ApiError(status_code=_response.status_code, body=_response_json)
691
693
 
694
+ def modify_passage(
695
+ self,
696
+ agent_id: str,
697
+ memory_id: str,
698
+ *,
699
+ id: str,
700
+ created_by_id: typing.Optional[str] = OMIT,
701
+ last_updated_by_id: typing.Optional[str] = OMIT,
702
+ created_at: typing.Optional[dt.datetime] = OMIT,
703
+ updated_at: typing.Optional[dt.datetime] = OMIT,
704
+ is_deleted: typing.Optional[bool] = OMIT,
705
+ passage_update_agent_id: typing.Optional[str] = OMIT,
706
+ source_id: typing.Optional[str] = OMIT,
707
+ file_id: typing.Optional[str] = OMIT,
708
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
709
+ text: typing.Optional[str] = OMIT,
710
+ embedding: typing.Optional[typing.Sequence[float]] = OMIT,
711
+ embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
712
+ request_options: typing.Optional[RequestOptions] = None,
713
+ ) -> typing.List[Passage]:
714
+ """
715
+ Modify a memory in the agent's archival memory store.
716
+
717
+ Parameters
718
+ ----------
719
+ agent_id : str
720
+
721
+ memory_id : str
722
+
723
+ id : str
724
+ The unique identifier of the passage.
725
+
726
+ created_by_id : typing.Optional[str]
727
+ The id of the user that made this object.
728
+
729
+ last_updated_by_id : typing.Optional[str]
730
+ The id of the user that made this object.
731
+
732
+ created_at : typing.Optional[dt.datetime]
733
+ The timestamp when the object was created.
734
+
735
+ updated_at : typing.Optional[dt.datetime]
736
+ The timestamp when the object was last updated.
737
+
738
+ is_deleted : typing.Optional[bool]
739
+ Whether this passage is deleted or not.
740
+
741
+ passage_update_agent_id : typing.Optional[str]
742
+ The unique identifier of the agent associated with the passage.
743
+
744
+ source_id : typing.Optional[str]
745
+ The data source of the passage.
746
+
747
+ file_id : typing.Optional[str]
748
+ The unique identifier of the file associated with the passage.
749
+
750
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
751
+ The metadata of the passage.
752
+
753
+ text : typing.Optional[str]
754
+ The text of the passage.
755
+
756
+ embedding : typing.Optional[typing.Sequence[float]]
757
+ The embedding of the passage.
758
+
759
+ embedding_config : typing.Optional[EmbeddingConfig]
760
+ The embedding configuration used by the passage.
761
+
762
+ request_options : typing.Optional[RequestOptions]
763
+ Request-specific configuration.
764
+
765
+ Returns
766
+ -------
767
+ typing.List[Passage]
768
+ Successful Response
769
+
770
+ Examples
771
+ --------
772
+ from letta_client import Letta
773
+
774
+ client = Letta(
775
+ token="YOUR_TOKEN",
776
+ )
777
+ client.agents.modify_passage(
778
+ agent_id="agent_id",
779
+ memory_id="memory_id",
780
+ id="id",
781
+ )
782
+ """
783
+ _response = self._client_wrapper.httpx_client.request(
784
+ f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory/{jsonable_encoder(memory_id)}",
785
+ method="PATCH",
786
+ json={
787
+ "created_by_id": created_by_id,
788
+ "last_updated_by_id": last_updated_by_id,
789
+ "created_at": created_at,
790
+ "updated_at": updated_at,
791
+ "is_deleted": is_deleted,
792
+ "agent_id": passage_update_agent_id,
793
+ "source_id": source_id,
794
+ "file_id": file_id,
795
+ "metadata_": metadata,
796
+ "text": text,
797
+ "embedding": embedding,
798
+ "embedding_config": convert_and_respect_annotation_metadata(
799
+ object_=embedding_config, annotation=EmbeddingConfig, direction="write"
800
+ ),
801
+ "id": id,
802
+ },
803
+ headers={
804
+ "content-type": "application/json",
805
+ },
806
+ request_options=request_options,
807
+ omit=OMIT,
808
+ )
809
+ try:
810
+ if 200 <= _response.status_code < 300:
811
+ return typing.cast(
812
+ typing.List[Passage],
813
+ construct_type(
814
+ type_=typing.List[Passage], # type: ignore
815
+ object_=_response.json(),
816
+ ),
817
+ )
818
+ if _response.status_code == 422:
819
+ raise UnprocessableEntityError(
820
+ typing.cast(
821
+ HttpValidationError,
822
+ construct_type(
823
+ type_=HttpValidationError, # type: ignore
824
+ object_=_response.json(),
825
+ ),
826
+ )
827
+ )
828
+ _response_json = _response.json()
829
+ except JSONDecodeError:
830
+ raise ApiError(status_code=_response.status_code, body=_response.text)
831
+ raise ApiError(status_code=_response.status_code, body=_response_json)
832
+
692
833
  def reset_messages(
693
834
  self,
694
835
  agent_id: str,
@@ -1519,6 +1660,153 @@ class AsyncAgentsClient:
1519
1660
  raise ApiError(status_code=_response.status_code, body=_response.text)
1520
1661
  raise ApiError(status_code=_response.status_code, body=_response_json)
1521
1662
 
1663
+ async def modify_passage(
1664
+ self,
1665
+ agent_id: str,
1666
+ memory_id: str,
1667
+ *,
1668
+ id: str,
1669
+ created_by_id: typing.Optional[str] = OMIT,
1670
+ last_updated_by_id: typing.Optional[str] = OMIT,
1671
+ created_at: typing.Optional[dt.datetime] = OMIT,
1672
+ updated_at: typing.Optional[dt.datetime] = OMIT,
1673
+ is_deleted: typing.Optional[bool] = OMIT,
1674
+ passage_update_agent_id: typing.Optional[str] = OMIT,
1675
+ source_id: typing.Optional[str] = OMIT,
1676
+ file_id: typing.Optional[str] = OMIT,
1677
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1678
+ text: typing.Optional[str] = OMIT,
1679
+ embedding: typing.Optional[typing.Sequence[float]] = OMIT,
1680
+ embedding_config: typing.Optional[EmbeddingConfig] = OMIT,
1681
+ request_options: typing.Optional[RequestOptions] = None,
1682
+ ) -> typing.List[Passage]:
1683
+ """
1684
+ Modify a memory in the agent's archival memory store.
1685
+
1686
+ Parameters
1687
+ ----------
1688
+ agent_id : str
1689
+
1690
+ memory_id : str
1691
+
1692
+ id : str
1693
+ The unique identifier of the passage.
1694
+
1695
+ created_by_id : typing.Optional[str]
1696
+ The id of the user that made this object.
1697
+
1698
+ last_updated_by_id : typing.Optional[str]
1699
+ The id of the user that made this object.
1700
+
1701
+ created_at : typing.Optional[dt.datetime]
1702
+ The timestamp when the object was created.
1703
+
1704
+ updated_at : typing.Optional[dt.datetime]
1705
+ The timestamp when the object was last updated.
1706
+
1707
+ is_deleted : typing.Optional[bool]
1708
+ Whether this passage is deleted or not.
1709
+
1710
+ passage_update_agent_id : typing.Optional[str]
1711
+ The unique identifier of the agent associated with the passage.
1712
+
1713
+ source_id : typing.Optional[str]
1714
+ The data source of the passage.
1715
+
1716
+ file_id : typing.Optional[str]
1717
+ The unique identifier of the file associated with the passage.
1718
+
1719
+ metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1720
+ The metadata of the passage.
1721
+
1722
+ text : typing.Optional[str]
1723
+ The text of the passage.
1724
+
1725
+ embedding : typing.Optional[typing.Sequence[float]]
1726
+ The embedding of the passage.
1727
+
1728
+ embedding_config : typing.Optional[EmbeddingConfig]
1729
+ The embedding configuration used by the passage.
1730
+
1731
+ request_options : typing.Optional[RequestOptions]
1732
+ Request-specific configuration.
1733
+
1734
+ Returns
1735
+ -------
1736
+ typing.List[Passage]
1737
+ Successful Response
1738
+
1739
+ Examples
1740
+ --------
1741
+ import asyncio
1742
+
1743
+ from letta_client import AsyncLetta
1744
+
1745
+ client = AsyncLetta(
1746
+ token="YOUR_TOKEN",
1747
+ )
1748
+
1749
+
1750
+ async def main() -> None:
1751
+ await client.agents.modify_passage(
1752
+ agent_id="agent_id",
1753
+ memory_id="memory_id",
1754
+ id="id",
1755
+ )
1756
+
1757
+
1758
+ asyncio.run(main())
1759
+ """
1760
+ _response = await self._client_wrapper.httpx_client.request(
1761
+ f"v1/agents/{jsonable_encoder(agent_id)}/archival-memory/{jsonable_encoder(memory_id)}",
1762
+ method="PATCH",
1763
+ json={
1764
+ "created_by_id": created_by_id,
1765
+ "last_updated_by_id": last_updated_by_id,
1766
+ "created_at": created_at,
1767
+ "updated_at": updated_at,
1768
+ "is_deleted": is_deleted,
1769
+ "agent_id": passage_update_agent_id,
1770
+ "source_id": source_id,
1771
+ "file_id": file_id,
1772
+ "metadata_": metadata,
1773
+ "text": text,
1774
+ "embedding": embedding,
1775
+ "embedding_config": convert_and_respect_annotation_metadata(
1776
+ object_=embedding_config, annotation=EmbeddingConfig, direction="write"
1777
+ ),
1778
+ "id": id,
1779
+ },
1780
+ headers={
1781
+ "content-type": "application/json",
1782
+ },
1783
+ request_options=request_options,
1784
+ omit=OMIT,
1785
+ )
1786
+ try:
1787
+ if 200 <= _response.status_code < 300:
1788
+ return typing.cast(
1789
+ typing.List[Passage],
1790
+ construct_type(
1791
+ type_=typing.List[Passage], # type: ignore
1792
+ object_=_response.json(),
1793
+ ),
1794
+ )
1795
+ if _response.status_code == 422:
1796
+ raise UnprocessableEntityError(
1797
+ typing.cast(
1798
+ HttpValidationError,
1799
+ construct_type(
1800
+ type_=HttpValidationError, # type: ignore
1801
+ object_=_response.json(),
1802
+ ),
1803
+ )
1804
+ )
1805
+ _response_json = _response.json()
1806
+ except JSONDecodeError:
1807
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1808
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1809
+
1522
1810
  async def reset_messages(
1523
1811
  self,
1524
1812
  agent_id: str,
@@ -16,7 +16,7 @@ class BaseClientWrapper:
16
16
  headers: typing.Dict[str, str] = {
17
17
  "X-Fern-Language": "Python",
18
18
  "X-Fern-SDK-Name": "letta-client",
19
- "X-Fern-SDK-Version": "0.1.49",
19
+ "X-Fern-SDK-Version": "0.1.51",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -80,6 +80,11 @@ class Step(UncheckedBaseModel):
80
80
  The unique identifier of the transaction that processed this step.
81
81
  """
82
82
 
83
+ trace_id: typing.Optional[str] = pydantic.Field(default=None)
84
+ """
85
+ The trace id of the agent step.
86
+ """
87
+
83
88
  messages: typing.Optional[typing.List[Message]] = pydantic.Field(default=None)
84
89
  """
85
90
  The messages generated during this step.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.49
3
+ Version: 0.1.51
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -1,8 +1,8 @@
1
1
  letta_client/__init__.py,sha256=bd8FHq-fZVf_PugqTtSZUPZoogZxcftmnDUhSK6rF54,55988
2
2
  letta_client/agents/__init__.py,sha256=KCn7wjwmY7PBtXQYfiFQPNtwPz5dPBB4A6V6V242U6w,22136
3
3
  letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
4
- letta_client/agents/blocks/client.py,sha256=x2651Wftl9J8GhtTkF0os6iposDvOirWa_vdmyEZB38,23746
5
- letta_client/agents/client.py,sha256=QGavj2Fh7TlDEbY7JtMoFUsgsiuQcoQ_1USGuIKUPjU,63861
4
+ letta_client/agents/blocks/client.py,sha256=u5zvutxoH_DqfSLWhRtNSRBC9_ezQDx682cxkxDz3JA,23822
5
+ letta_client/agents/client.py,sha256=YUFtT3ZBHyvUcK-IbAchSbYRJprGB9aR2eedNdI6r3g,73961
6
6
  letta_client/agents/context/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
7
7
  letta_client/agents/context/client.py,sha256=GKKvoG4N_K8Biz9yDjeIHpFG0C8Cwc7tHmEX3pTL_9U,4815
8
8
  letta_client/agents/core_memory/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
@@ -207,7 +207,7 @@ letta_client/blocks/client.py,sha256=AeQQ-IdYhV-zqLTt3PTrJOtJ6XtBZcXNC108Y5EogVU
207
207
  letta_client/client.py,sha256=y2cXN0ApFul2Lz-fVh5TbeYbQ8oUjnXcwJ6wUczEf2c,2457
208
208
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
209
209
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
210
- letta_client/core/client_wrapper.py,sha256=IkDk9_tW0oCl3O_cWSG7SShaoSyz8EuhR2WMhAn1Kwk,1997
210
+ letta_client/core/client_wrapper.py,sha256=Bd0NuPcNX1NfNfPI7hld8sDV3ijuYyYrQS_Raqk6RfQ,1997
211
211
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
212
212
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
213
213
  letta_client/core/http_client.py,sha256=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
@@ -559,7 +559,7 @@ letta_client/types/sandbox_environment_variable_create.py,sha256=AhGE8ITStXkPOfP
559
559
  letta_client/types/sandbox_environment_variable_update.py,sha256=JMkX6nzvcBNEemjvBmyHDezci3Bn7epKhMnvFY_--EA,948
560
560
  letta_client/types/sandbox_type.py,sha256=XSWmX3JIFFrDPQ4i89E8LauXY8kjmJEtaz6e_JheGm4,151
561
561
  letta_client/types/source.py,sha256=7tLptZ4AZrvRPF6NqToM4Vf9i7TosS2_Ydks4zfvZx4,2239
562
- letta_client/types/step.py,sha256=K9ms9JV9DE8C7eJMLGNK-LZt_9nh7Lykw2c0COzScBg,2737
562
+ letta_client/types/step.py,sha256=zEhNkgsX_WiVl6firIEZRnRsN-9aPPf2mx3245Z2iWQ,2856
563
563
  letta_client/types/system_message.py,sha256=DUIgPbL_ya49sGN15DIEGO2t8OQ4pseHvbMcayygV0c,1155
564
564
  letta_client/types/system_message_content.py,sha256=9VvwCUKMkNidcMUaPmuj6-WhzeJoEZCNvyn3oH-LR70,185
565
565
  letta_client/types/terminal_tool_rule.py,sha256=82a7AnohOqCFBSOt7OwsKeh7gHgq8KTlgojxlm3t76E,863
@@ -586,6 +586,6 @@ letta_client/voice/__init__.py,sha256=ZrZEuXIukVGhsfM-i0dIFfqjeSOBMPeEgDva7Vvnip
586
586
  letta_client/voice/client.py,sha256=j3feSlNzeTVFXE7RUKEHGeMl_w0TJFBRUI3pXpLpUEI,6148
587
587
  letta_client/voice/types/__init__.py,sha256=hBLJcrom99DkDxxsVRU2ni8kPx6SsCy8gtAJvNOz26w,199
588
588
  letta_client/voice/types/create_voice_chat_completions_request.py,sha256=K4__83rXRCshfdobyAmH-5fUDJQ_PeSQetTUeC4Abk0,381
589
- letta_client-0.1.49.dist-info/METADATA,sha256=ukpZNLwd0zDeYSSK9o0u_Lnbs2wGPmBtt0MM3EVxrSI,4942
590
- letta_client-0.1.49.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
591
- letta_client-0.1.49.dist-info/RECORD,,
589
+ letta_client-0.1.51.dist-info/METADATA,sha256=v5O-cIMfjSTXLAWFt1dLAKUknb-blHbSvMLPIZKv1uE,4942
590
+ letta_client-0.1.51.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
591
+ letta_client-0.1.51.dist-info/RECORD,,