Skip to content

Commit

Permalink
Merge branch 'master' into fix/docs-triggers-get-started
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekpatil4 authored Dec 12, 2024
2 parents 738d8f1 + 051bfa0 commit 3dfd888
Show file tree
Hide file tree
Showing 29 changed files with 179 additions and 94 deletions.
67 changes: 43 additions & 24 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ on:
push:
branches:
- master
paths:
- 'python/**'
pull_request:
paths:
- 'python/**'

jobs:
lock_check:
Expand Down Expand Up @@ -59,11 +55,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
pip install 'tox>=4.21,<5' tox-uv
- name: Code style check
run: |
tox -e black-diff
Expand All @@ -79,8 +71,6 @@ jobs:
run:
working-directory: ./python
continue-on-error: False
needs:
- lock_check
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -100,32 +90,65 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
pip install 'tox>=4.21,<5' tox-uv
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'not e2e'
tox -e test -- -m 'not e2e and not swe'
- if: matrix.python-version == '3.10'
name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

swe:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 20
concurrency:
group: 'test:swe:${{ matrix.python-version }}:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install 'tox>=4.21,<5' tox-uv
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'swe'
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

e2e:
defaults:
run:
working-directory: ./python
continue-on-error: False
needs:
- lock_check
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -154,11 +177,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
pip install 'tox>=4.21,<5' tox-uv
- name: Build docker images
run: |
cd dockerfiles
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ jobs:
COMPOSIO_BASE_URL: ${{ inputs.base_url || secrets.COMPOSIO_BASE_URL || 'https://backend.composio.dev/api' }}
# TODO(@kaavee): Add Anthropic API key
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
python -m pip install --upgrade pip pipenv pytest
python -m pip install plugins/${{matrix.package}}
python -m pip install '.[all]'
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
COMPOSIO_BASE_URL: https://backend.composio.dev/api
COMPOSIO_API_KEY: ${{secrets.COMPOSIO_API_KEY_RELEASE}}
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
# Setup release
python -m pip install --upgrade pip
python -m pip install .
Expand Down Expand Up @@ -91,10 +87,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Build ${{ matrix.package }}
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
python -m pip install --upgrade pip
pip install twine build
# Build dist
Expand Down Expand Up @@ -128,10 +120,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
python -m pip install --upgrade pip
pip install twine build
# Build dist
Expand Down
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"openapispec:generate": "npx @hey-api/openapi-ts",
"run:cli": "ts-node src/cli/index.ts",
"run:sample": "ts-node sample.ts",
"eslint": "eslint 'src/**/*.{ts,js}' --max-warnings=281",
"eslint": "eslint 'src/**/*.{ts,js}' --max-warnings=261",
"prettier": "prettier --write 'src/**/*.{ts,js,cjs}'",
"prettier:check": "prettier --check 'src/**/*.{ts,js,mjs,cjs}'",
"build": "rollup -c rollup.config.mjs && ./setup_cli.sh",
Expand Down
74 changes: 74 additions & 0 deletions js/src/cli/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import chalk from "chalk";
import { Command } from "commander";
import client from "../sdk/client/client";
import { getOpenAPIClient } from "../sdk/utils/config";
import { ListActionsV2Data } from "../sdk/client";

export default class ActionCommand {
private program: Command;

constructor(program: Command) {
this.program = program;
this.program
.command("actions")
.description("Composio Actions")
.option(
"-a, --apps <appName>",
"List all actions for the given apps",
(value, previous: string[]) => previous.concat([value]),
[]
)
.option(
"--tags <tagName>",
"List all actions for the given tags",
(value, previous: string[]) => previous.concat([value]),
[]
)
.option(
"--use-case <useCase>",
"Search for actions based on the given use case"
)
.option("--limit <limit>", "Limit the number of actions to display")
.option("--enabled", "Only show enabled actions")
.action(this.handleAction.bind(this));
}

private async handleAction(options: {
apps?: string[];
tags?: string[];
useCase?: string;
limit?: number;
enabled?: boolean;
}): Promise<void> {
getOpenAPIClient();
const { apps = [], tags = [], useCase, limit, enabled } = options;
if (apps.length === 0) {
console.log(chalk.red("Please provide at least one app name"));

Check warning on line 46 in js/src/cli/actions.ts

View workflow job for this annotation

GitHub Actions / lint-and-prettify

Unexpected console statement
return;
}
const data: ListActionsV2Data = {
query: {
apps: apps.join(","),
...(tags.length && { tags: tags.join(",") }),
...(limit && { limit }),
...(enabled && { showEnabledOnly: enabled }),
...(useCase && { useCase }),
},
};
try {
const response = await client.actionsV2.listActionsV2(data);
if (response.data?.items.length === 0) {
console.log(chalk.yellow("No actions found"));

Check warning on line 61 in js/src/cli/actions.ts

View workflow job for this annotation

GitHub Actions / lint-and-prettify

Unexpected console statement
return;
}
console.log(chalk.green("Here are the actions for the app:"));

Check warning on line 64 in js/src/cli/actions.ts

View workflow job for this annotation

GitHub Actions / lint-and-prettify

Unexpected console statement
console.log("");

Check warning on line 65 in js/src/cli/actions.ts

View workflow job for this annotation

GitHub Actions / lint-and-prettify

Unexpected console statement
// render list
const actions = response.data?.items || [];
actions.forEach((action) => console.log(action.name));

Check warning on line 68 in js/src/cli/actions.ts

View workflow job for this annotation

GitHub Actions / lint-and-prettify

Unexpected console statement
} catch (error) {
console.log(chalk.red((error as Error)?.message));

Check warning on line 70 in js/src/cli/actions.ts

View workflow job for this annotation

GitHub Actions / lint-and-prettify

Unexpected console statement
return;
}
}
}
2 changes: 2 additions & 0 deletions js/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import login from "./login";
import logout from "./logout";
import triggers from "./triggers";
import whoami from "./whoami";
import actions from "./actions";

// SDK Imports
import { TELEMETRY_EVENTS } from "../sdk/utils/telemetry/events";
Expand All @@ -28,6 +29,7 @@ new connections(program);
new integrations(program);
new triggers(program);
new add(program);
new actions(program);

function formatLine(content: string): string {
return `${content}`;
Expand Down
2 changes: 1 addition & 1 deletion python/composio/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.0-rc.1"
__version__ = "0.6.0"
9 changes: 3 additions & 6 deletions python/composio/utils/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ def _fetch_latest_version():


def create_latest_version_warning_hook(version: str):
if os.environ.get("COMPOSIO_DISABLE_VERSION_CHECK", "false").lower() != "false":
return lambda: None

version_thread = threading.Thread(target=_fetch_latest_version, daemon=True)
version_thread.start()

def latest_version_warning() -> None:
try:
if (
os.environ.get("COMPOSIO_DISABLE_VERSION_CHECK", "false").lower()
== "true"
):
return

version_thread.join(timeout=0.1)
if _latest_version is None:
return
Expand Down
2 changes: 1 addition & 1 deletion python/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN /bin/python3 -m venv .composio/venv
RUN export PATH=$PATH:$(pwd)/.composio/venv/bin

# Install composio
RUN python -m pip install composio-core[all]==0.5.48-rc.1 fastapi playwright uvicorn
RUN python -m pip install composio-core[all]==0.6.0 fastapi playwright uvicorn

# Install playwright deps
RUN playwright install-deps
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/autogen/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_autogen",
version="0.6.0-rc.1",
version="0.6.0",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Autogen agent.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.6.0-rc.1",
"composio_core>=0.5.0,<=0.6.0",
"pyautogen>=0.2.19",
"flaml==2.2.0",
],
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/camel/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_camel",
version="0.6.0-rc.1",
version="0.6.0",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Claude LLMs.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.6.0-rc.1",
"composio_core>=0.5.0,<=0.6.0",
"camel-ai>=0.1.5.7,<=0.2.2",
"pillow",
],
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/claude/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_claude",
version="0.6.0-rc.1",
version="0.6.0",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Claude LLMs.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_openai>=0.5.50,<=0.6.0-rc.1", "anthropic>=0.25.7"],
install_requires=["composio_openai>=0.5.0,<=0.6.0", "anthropic>=0.25.7"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions python/plugins/crew_ai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_crewai",
version="0.6.0-rc.1",
version="0.6.0",
author="Himanshu",
author_email="himanshu@composio.dev",
description="Use Composio to get an array of tools with your CrewAI agent.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_langchain>=0.5.50,<=0.6.0-rc.1",
"composio_langchain>=0.5.0,<=0.6.0",
"crewai>=0.51.0",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/google/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_google",
version="0.6.0-rc.1",
version="0.6.0",
author="Assistant",
author_email="karan@composio.dev",
description="Use Composio to get an array of tools with your Google AI Python Gemini model.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.6.0-rc.1",
"composio_core>=0.5.0,<=0.6.0",
"google-cloud-aiplatform>=1.38.0",
],
include_package_data=True,
Expand Down
Loading

0 comments on commit 3dfd888

Please sign in to comment.