Skip to content

Commit

Permalink
feat: add versioned actions usages to docs (#1332)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekpatil4 authored Feb 12, 2025
1 parent 9ae2198 commit 1cea215
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
]
},
"patterns/tools/custom-integration",
"patterns/tools/serve-tools"
"patterns/tools/serve-tools",
"patterns/tools/versioning"
]
},
{
Expand Down
56 changes: 56 additions & 0 deletions docs/patterns/tools/versioning.mdx
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>

0 comments on commit 1cea215

Please sign in to comment.