letta-nightly 0.4.1.dev20241009104130__py3-none-any.whl → 0.4.1.dev20241010104112__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-nightly might be problematic. Click here for more details.
- letta/agent_store/db.py +23 -7
- letta/cli/cli.py +2 -1
- letta/cli/cli_config.py +1 -1098
- letta/client/utils.py +7 -2
- letta/embeddings.py +3 -0
- letta/interface.py +6 -2
- letta/llm_api/google_ai.py +1 -1
- letta/llm_api/helpers.py +11 -4
- letta/llm_api/llm_api_tools.py +2 -12
- letta/llm_api/openai.py +1 -0
- letta/local_llm/constants.py +3 -0
- letta/providers.py +26 -1
- letta/server/server.py +8 -2
- letta/streaming_interface.py +8 -4
- {letta_nightly-0.4.1.dev20241009104130.dist-info → letta_nightly-0.4.1.dev20241010104112.dist-info}/METADATA +1 -1
- {letta_nightly-0.4.1.dev20241009104130.dist-info → letta_nightly-0.4.1.dev20241010104112.dist-info}/RECORD +19 -22
- letta/configs/anthropic.json +0 -13
- letta/configs/letta_hosted.json +0 -11
- letta/configs/openai.json +0 -12
- {letta_nightly-0.4.1.dev20241009104130.dist-info → letta_nightly-0.4.1.dev20241010104112.dist-info}/LICENSE +0 -0
- {letta_nightly-0.4.1.dev20241009104130.dist-info → letta_nightly-0.4.1.dev20241010104112.dist-info}/WHEEL +0 -0
- {letta_nightly-0.4.1.dev20241009104130.dist-info → letta_nightly-0.4.1.dev20241010104112.dist-info}/entry_points.txt +0 -0
letta/agent_store/db.py
CHANGED
|
@@ -398,8 +398,6 @@ class PostgresStorageConnector(SQLStorageConnector):
|
|
|
398
398
|
return records
|
|
399
399
|
|
|
400
400
|
def insert_many(self, records, exists_ok=True, show_progress=False):
|
|
401
|
-
pass
|
|
402
|
-
|
|
403
401
|
# TODO: this is terrible, should eventually be done the same way for all types (migrate to SQLModel)
|
|
404
402
|
if len(records) == 0:
|
|
405
403
|
return
|
|
@@ -506,18 +504,36 @@ class SQLLiteStorageConnector(SQLStorageConnector):
|
|
|
506
504
|
# sqlite3.register_converter("UUID", lambda b: uuid.UUID(bytes_le=b))
|
|
507
505
|
|
|
508
506
|
def insert_many(self, records, exists_ok=True, show_progress=False):
|
|
509
|
-
pass
|
|
510
|
-
|
|
511
507
|
# TODO: this is terrible, should eventually be done the same way for all types (migrate to SQLModel)
|
|
512
508
|
if len(records) == 0:
|
|
513
509
|
return
|
|
510
|
+
|
|
511
|
+
added_ids = [] # avoid adding duplicates
|
|
512
|
+
# NOTE: this has not great performance due to the excessive commits
|
|
514
513
|
with self.session_maker() as session:
|
|
515
514
|
iterable = tqdm(records) if show_progress else records
|
|
516
515
|
for record in iterable:
|
|
517
516
|
# db_record = self.db_model(**vars(record))
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
|
|
518
|
+
if record.id in added_ids:
|
|
519
|
+
continue
|
|
520
|
+
|
|
521
|
+
existing_record = session.query(self.db_model).filter_by(id=record.id).first()
|
|
522
|
+
if existing_record:
|
|
523
|
+
if exists_ok:
|
|
524
|
+
fields = record.model_dump()
|
|
525
|
+
fields.pop("id")
|
|
526
|
+
session.query(self.db_model).filter(self.db_model.id == record.id).update(fields)
|
|
527
|
+
session.commit()
|
|
528
|
+
else:
|
|
529
|
+
raise ValueError(f"Record with id {record.id} already exists.")
|
|
530
|
+
|
|
531
|
+
else:
|
|
532
|
+
db_record = self.db_model(**record.dict())
|
|
533
|
+
session.add(db_record)
|
|
534
|
+
session.commit()
|
|
535
|
+
|
|
536
|
+
added_ids.append(record.id)
|
|
521
537
|
|
|
522
538
|
def insert(self, record, exists_ok=True):
|
|
523
539
|
self.insert_many([record], exists_ok=exists_ok)
|
letta/cli/cli.py
CHANGED
|
@@ -11,6 +11,7 @@ from letta import create_client
|
|
|
11
11
|
from letta.agent import Agent, save_agent
|
|
12
12
|
from letta.config import LettaConfig
|
|
13
13
|
from letta.constants import CLI_WARNING_PREFIX, LETTA_DIR
|
|
14
|
+
from letta.local_llm.constants import ASSISTANT_MESSAGE_CLI_SYMBOL
|
|
14
15
|
from letta.log import get_logger
|
|
15
16
|
from letta.metadata import MetadataStore
|
|
16
17
|
from letta.schemas.enums import OptionState
|
|
@@ -276,7 +277,7 @@ def run(
|
|
|
276
277
|
memory = ChatMemory(human=human_obj.value, persona=persona_obj.value, limit=core_memory_limit)
|
|
277
278
|
metadata = {"human": human_obj.name, "persona": persona_obj.name}
|
|
278
279
|
|
|
279
|
-
typer.secho(f"->
|
|
280
|
+
typer.secho(f"-> {ASSISTANT_MESSAGE_CLI_SYMBOL} Using persona profile: '{persona_obj.name}'", fg=typer.colors.WHITE)
|
|
280
281
|
typer.secho(f"-> 🧑 Using human profile: '{human_obj.name}'", fg=typer.colors.WHITE)
|
|
281
282
|
|
|
282
283
|
# add tools
|