Files
letta-server/letta/schemas/npm_requirement.py
Kian Jones b8e9a80d93 merge this (#4759)
* wait I forgot to comit locally

* cp the entire core directory and then rm the .git subdir
2025-09-17 15:47:40 -07:00

13 lines
457 B
Python

from pydantic import BaseModel, Field
class NpmRequirement(BaseModel):
name: str = Field(..., min_length=1, description="Name of the npm package.")
version: str | None = Field(None, description="Optional version of the package, following semantic versioning.")
def __str__(self) -> str:
"""Return a npm-installable string format."""
if self.version:
return f'{self.name}@"{self.version}"'
return self.name