-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add versioned actions usages to docs (#1332)
- Loading branch information
1 parent
9ae2198
commit 1cea215
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: "Action Versioning" | ||
sidebarTitle: "Action Versioning" | ||
description: "Learn how to use versioned actions in Composio" | ||
--- | ||
|
||
Composio supports semantic versioning for actions to ensure stable and consistent interfaces. This guide explains how version specifiers work and how to use them in your applications. | ||
|
||
## Versioning Policies | ||
|
||
Composio follows semantic versioning principles: | ||
|
||
- **Minor Version Changes** (0_1 → 0_2) | ||
- Non-breaking interface changes | ||
- Examples: Adding optional parameters, extending functionality | ||
- Backward compatible with previous minor versions | ||
|
||
- **Major Version Changes** (0_3 → 1_0) | ||
- Breaking interface changes | ||
- Examples: Action deprecation or replacement, Changes in required parameters, Changes in parameter types or formats | ||
- May require updates to existing code | ||
|
||
## Version Specifiers | ||
|
||
Composio provides several ways to specify which version of an action you want to use: | ||
|
||
- `latest` - Uses the most recent version available. For example, if an action has versions 0_1, 0_2, 0_3, 1_0, and 1_1, `latest` will resolve to `1_1`. | ||
- `latest:base` - Uses the latest version before a major version change. Using the same example versions, `latest:base` would resolve to `0_3`. | ||
- `x_y` - Explicitly specify major (x) and minor (y) versions, like `0_1` or `1_0`. | ||
|
||
## Using Versions in Code | ||
|
||
Here's how to specify versions when using Composio: | ||
|
||
<CodeGroup> | ||
```python Python {7,10,13} | ||
from composio_langchain import ComposioToolSet, Action | ||
|
||
# Initialize toolset | ||
toolset = ComposioToolSet() | ||
|
||
# Use latest base version (default) | ||
tools = toolset.get_tools(actions=[Action.GITHUB_META_ROOT @ "latest:base"]) | ||
|
||
# Use latest version | ||
tools = toolset.get_tools(actions=[Action.GITHUB_META_ROOT @ "latest"]) | ||
|
||
# Use specific version | ||
tools = toolset.get_tools(actions=[Action.GITHUB_META_ROOT @ "0_1"]) | ||
``` | ||
``` javascript JavaScript | ||
coming soon! | ||
``` | ||
</CodeGroup> | ||
|
||
<Info>If no version is specified it defaults to `latest:base`</Info> |