Skip to content

Commit 28a6a62

Browse files
Upgrade to version 1.1.1 (#3)
* chore: Update repository URLs to getlatedev/late-python-sdk * fix: Resolve lint errors and update MCP test imports * fix: Resolve mypy errors and add params to HTTP methods * ci: Improve release workflow with better visibility and PyPI check - Add release summary in GitHub Actions - Check if version exists on PyPI before publishing - Show clear notices for skip/release decisions - Bump version to 1.0.1 * ci: Add release preview comment on PRs to main Shows version info and release status before merging: - Version from pyproject.toml - Whether git tag exists - Whether version exists on PyPI - Clear indication if release will happen or be skipped * chore: trigger workflow re-run * fix: Add explicit permissions for checkout in private repo * fix: Add explicit token and permissions to all workflows for private repo * feat: Add typed responses with Pydantic models (v1.1.0) - All resource methods now return typed Pydantic models instead of dicts - Generate proper Enum classes instead of Literal types - Add response models: PostsListResponse, ProfileGetResponse, etc. - Add upload module with direct and Vercel Blob support - Update tests to use attribute access syntax - Sync version to 1.1.0 across pyproject.toml and __init__.py * feat(mcp): Add is_draft parameter and centralized tool definitions - Add is_draft parameter to posts_create and posts_cross_post - Create tool_definitions.py as single source of truth for MCP params - Add script to generate MDX docs from definitions * fix: Move Callable imports to TYPE_CHECKING block and fix trailing whitespace * fix: Fix mypy errors and format code * feat(ai): Add model property to OpenAI provider * Refactor MCP server to use typed models and tool docs Refactors MCP server to use typed model attributes instead of dicts for accounts, profiles, and posts, improving type safety and code clarity. Adds the @use_tool_def decorator to all MCP tool functions, automatically applying centralized docstrings from tool_definitions.py. Updates tool_definitions.py to expand tool documentation, add summaries, and improve MDX generation. Updates README examples to use enums and new tool names. Bumps version to 1.1.1 and regenerates models for improved type annotations. * Update lint config and import Any in server.py Added per-file ignores for generated models in Ruff config to allow old-style annotations and trailing whitespace. Also imported 'Any' from typing in src/late/mcp/server.py. --------- Co-authored-by: Carlos Martínez <carlimvg02@gmail.com>
1 parent beda58c commit 28a6a62

8 files changed

Lines changed: 797 additions & 599 deletions

File tree

‎README.md‎

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ pip install late-sdk
1717
## Quick Start
1818

1919
```python
20-
from late import Late
20+
from datetime import datetime, timedelta
21+
from late import Late, Platform
2122

2223
client = Late(api_key="your_api_key")
2324

2425
# List connected accounts
2526
accounts = client.accounts.list()
2627

2728
# Create a scheduled post
28-
from datetime import datetime, timedelta
29-
3029
post = client.posts.create(
3130
content="Hello from Late!",
32-
platforms=[{"platform": "twitter", "accountId": "your_account_id"}],
31+
platforms=[{"platform": Platform.TWITTER, "accountId": "your_account_id"}],
3332
scheduled_for=datetime.now() + timedelta(hours=1),
3433
)
3534
```
@@ -119,13 +118,13 @@ Since Claude can't access local files, use the browser upload flow:
119118

120119
| Command | What it does |
121120
|---------|--------------|
122-
| `list_accounts` | Show connected social accounts |
123-
| `create_post` | Create scheduled or immediate post |
124-
| `publish_now` | Publish immediately |
125-
| `cross_post` | Post to multiple platforms |
126-
| `list_posts` | Show your posts |
127-
| `retry_post` | Retry a failed post |
128-
| `generate_upload_link` | Get link to upload media |
121+
| `accounts_list` | Show connected social accounts |
122+
| `posts_create` | Create scheduled, immediate, or draft post |
123+
| `posts_publish_now` | Publish immediately |
124+
| `posts_cross_post` | Post to multiple platforms |
125+
| `posts_list` | Show your posts |
126+
| `posts_retry` | Retry a failed post |
127+
| `media_generate_upload_link` | Get link to upload media |
129128

130129
---
131130

@@ -144,22 +143,27 @@ async def main():
144143
asyncio.run(main())
145144
```
146145

147-
### AI Content Generation
146+
### AI Content Generation (Experimental)
148147

149148
```bash
150149
pip install late-sdk[ai]
151150
```
152151

153152
```python
153+
from late import Platform, CaptionTone
154154
from late.ai import ContentGenerator, GenerateRequest
155155

156-
generator = ContentGenerator(provider="openai", api_key="sk-...")
156+
generator = ContentGenerator(
157+
provider="openai",
158+
api_key="sk-...",
159+
model="gpt-4o-mini", # or gpt-4o, gpt-4-turbo, etc.
160+
)
157161

158162
response = generator.generate(
159163
GenerateRequest(
160164
prompt="Write a tweet about Python",
161-
platform="twitter",
162-
tone="casual",
165+
platform=Platform.TWITTER,
166+
tone=CaptionTone.CASUAL,
163167
)
164168
)
165169

@@ -185,15 +189,16 @@ results = pipeline.schedule("posts.csv")
185189
### Cross-Posting
186190

187191
```python
192+
from late import Platform
188193
from late.pipelines import CrossPosterPipeline, PlatformConfig
189194

190195
cross_poster = CrossPosterPipeline(client)
191196

192197
results = await cross_poster.post(
193198
content="Big announcement!",
194199
platforms=[
195-
PlatformConfig("twitter", "tw_123"),
196-
PlatformConfig("linkedin", "li_456", delay_minutes=5),
200+
PlatformConfig(Platform.TWITTER, "tw_123"),
201+
PlatformConfig(Platform.LINKEDIN, "li_456", delay_minutes=5),
197202
],
198203
)
199204
```

‎pyproject.toml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "late-sdk"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
description = "Python SDK for Late API - Social Media Scheduling"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -113,6 +113,10 @@ ignore = [
113113
"B008", # do not perform function calls in argument defaults
114114
]
115115

116+
[tool.ruff.lint.per-file-ignores]
117+
"**/models/_generated/*" = ["UP006", "UP007", "UP035", "W291"] # Allow old-style annotations and trailing whitespace in generated code
118+
"**/models/_generated/**" = ["UP006", "UP007", "UP035", "W291"]
119+
116120
[tool.ruff.lint.isort]
117121
known-first-party = ["late"]
118122

‎scripts/generate_mcp_docs.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
This script generates MDX documentation from the centralized tool definitions
99
in src/late/mcp/tool_definitions.py
10+
11+
The generated output can be copied into the docs site.
1012
"""
1113

1214
import sys
@@ -15,18 +17,19 @@
1517
# Add src to path for imports
1618
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
1719

18-
from late.mcp.tool_definitions import generate_mdx_docs, TOOL_DEFINITIONS
20+
from late.mcp.tool_definitions import TOOL_DEFINITIONS, generate_mdx_tools_reference
1921

2022

21-
def main():
23+
def main() -> None:
2224
"""Generate and print MDX documentation."""
2325
print("=" * 60)
2426
print("MCP Tool Documentation (generated from tool_definitions.py)")
2527
print("=" * 60)
2628
print()
27-
print(generate_mdx_docs())
29+
print(generate_mdx_tools_reference())
2830
print()
2931
print("=" * 60)
32+
print(f"Total tools: {len(TOOL_DEFINITIONS)}")
3033
print("Copy the above into claude-mcp.mdx under '## Tool Reference'")
3134
print("=" * 60)
3235

‎src/late/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Visibility,
3232
)
3333

34-
__version__ = "1.1.0"
34+
__version__ = "1.1.1"
3535

3636
__all__ = [
3737
# Client

0 commit comments

Comments
 (0)