Skip to main content

Using Composio With Lyzr

Integrate Composio with Lyzr agents to allow them to interact seamlessly with external apps, enhancing their functionality and reach.

Goal

  • Star a repository on GitHub using natural language commands through a LangChain Agent.

Installation and Setup

Ensure you have the necessary packages installed and connect your GitHub account to allow your agents to utilize GitHub functionalities.

# Install Composio LangChain package
pip install composio-lyzr

# Connect your GitHub account
composio-cli add github

# View available applications you can connect with
composio-cli show-apps

Usage

from  lyzr_automata  import  Task, Agent
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata.tasks.task_literals import InputType, OutputType
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline

import os
import dotenv
dotenv.load_dotenv()
from composio_lyzr import ComposioToolSet, App, Action

open_ai_text_completion_model = OpenAIModel(
    api_key=os.environ["OPENAI_API_KEY"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)


lyzr_agent = Agent(
        role="Github Agent",
        prompt_persona="You are AI agent that is responsible for taking actions on Github on users behalf. You need to take action on Github using Github APIs"
    )

composio_toolset = ComposioToolSet()
composio_tool = composio_toolset.get_lyzr_tool(Action.GITHUB_STAR_REPO)

task = Task(
        name="Github Starring",
        agent=lyzr_agent,
        tool=composio_tool,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
        model=open_ai_text_completion_model,
        instructions="Star a repo composiohq/composio on GitHub",
        log_output=True,
        enhance_prompt=False,
)

lyzr_output = LinearSyncPipeline(
    name="Composio Lyzr",
		# completion message after pipeline completes
    completion_message="Task completed",
    tasks=[
				# tasks are instance of Task class
        task,
    ],
).run()

print(lyzr_output)

Metadata

Release files for composio-lyzr 0.7.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for composio-lyzr 0.7.20
File Size Uploaded Provenance Actions
composio_lyzr-0.7.20.tar.gz 3.7 kB Without provenance Details for composio_lyzr-0.7.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for composio-lyzr 0.7.20
File Interpreter ABI Platform Actions
composio_lyzr-0.7.20-py3-none-any.whl Python 3 none any Details for composio_lyzr-0.7.20-py3-none-any.whl

Total release size: 7.7 kB

Release files / composio_lyzr-0.7.20.tar.gz

Download URL composio_lyzr-0.7.20.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7898e196193bd72aa4d9070c2e1f8817523bf9f7519c85bb74f0e7e63fc77924
BLAKE2b-256 checksum
How to use checksums
75a1530b0045c6ac937dd35fb8aa4adb62c37ef5a33324008928eb28cfdbae92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / composio_lyzr-0.7.20-py3-none-any.whl

Download URL composio_lyzr-0.7.20-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21969eac5eb233a17de5429b3717d487ee24e52881ff3afd2d425418b3368fee
BLAKE2b-256 checksum
How to use checksums
4d4af728092b26e5ea2e5ebeb976eb9f1038797cfe6dc921cb34d55763ef518a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for composio-lyzr 0.7.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.20 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page