Commit Graph

11 Commits

Author SHA1 Message Date
Kian Jones
a206f7f345 feat: add ID format validation to agent and user schemas (#9151)
* feat: add ID format validation to agent and user schemas

Reuse existing validator types (ToolId, SourceId, BlockId, MessageId,
IdentityId, UserId) from letta.validators to enforce ID format validation
at the schema level. This ensures malformed IDs are rejected with a 422
validation error instead of causing 500 database errors.

Changes:
- CreateAgent: validate tool_ids, source_ids, folder_ids, block_ids, identity_ids
- UpdateAgent: validate tool_ids, source_ids, folder_ids, block_ids, message_ids, identity_ids
- UserUpdate: validate id

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* chore: regenerate API spec and SDK

* fix: override ID validation in AgentSchema for agent file portability

AgentSchema extends CreateAgent but needs to allow arbitrary short IDs
(e.g., tool-0, block-0) for portable agent files. Override the validated
ID fields to use plain List[str] instead of the validated types.

Also fix test_agent.af to use proper UUID-format IDs.

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* chore: regenerate API spec and SDK

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix: revert test_agent.af - short IDs are valid for agent files

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix openapi schema

---------

Co-authored-by: Letta <noreply@letta.com>
2026-02-24 10:52:06 -08:00
Sarah Wooders
19e6b09da5 docs: remove schemas from docstrings (#6059) 2025-11-13 15:36:56 -08:00
Kian Jones
3f78c93be5 chore: add new primitive types and replace id_prefixes everywhere (#5749)
add new primitive types and replace id_prefixes everywhere
2025-11-13 15:35:41 -08:00
cthomas
484a6f1d37 fix: parallel tool calling OpenAI (#2738) 2025-06-10 14:27:01 -07:00
Caren Thomas
7144fd2867 run black, add isort config to pyproject.toml 2024-12-26 19:43:11 -08:00
Shubham Naik
4cf354c033 fix: add tests to cypress 2024-12-23 14:44:08 -08:00
Matthew Zhou
b3f86fe4cd chore: Move ID generation logic out of the ORM layer and into the Pydantic model layer (#1981) 2024-11-05 17:05:10 -08:00
Shubham Naik
564f0ace0f chore: Migrate database (#1974)
Co-authored-by: Shubham Naik <shub@memgpt.ai>
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2024-11-03 11:17:49 -08:00
Matthew Zhou
d74406af41 feat: Add orm for Tools and clean up Tool logic (#1935) 2024-10-25 14:25:40 -07:00
Matthew Zhou
ff4be4576b feat: Add ORM for user model (#1924) 2024-10-23 10:28:00 -07:00
Sarah Wooders
8ae1e64987 chore: migrate package name to letta (#1775)
Co-authored-by: Charles Packer <packercharles@gmail.com>
Co-authored-by: Shubham Naik <shubham.naik10@gmail.com>
Co-authored-by: Shubham Naik <shub@memgpt.ai>
2024-09-23 09:15:18 -07:00