Skip to main content

Use Composio to get an array of tools with your Lyzr workflow.

Project description

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)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

composio_lyzr-0.5.34.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

composio_lyzr-0.5.34-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file composio_lyzr-0.5.34.tar.gz.

File metadata

  • Download URL: composio_lyzr-0.5.34.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for composio_lyzr-0.5.34.tar.gz
Algorithm Hash digest
SHA256 4529caa1d751ed9d5b4249580779774e4c648eafdd895273b55656223b130331
MD5 ee49b02272a88358abda615f07c25d3a
BLAKE2b-256 f7d6ff4d60abaeb6c292abf3c319e5db343515bfe2986e7c57cbe18e15f81176

See more details on using hashes here.

File details

Details for the file composio_lyzr-0.5.34-py3-none-any.whl.

File metadata

File hashes

Hashes for composio_lyzr-0.5.34-py3-none-any.whl
Algorithm Hash digest
SHA256 89c8f2a32cc8210e679ee782c538dc002a58c6a0e3ff5eb70d10a148752340c9
MD5 223798c997dc46e15048c26fb6286257
BLAKE2b-256 784895edbd1d7996afaf414e915cf61c01316728f65dde2f999d340b26c5d7a9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page