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.6.8.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

composio_lyzr-0.6.8-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: composio_lyzr-0.6.8.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for composio_lyzr-0.6.8.tar.gz
Algorithm Hash digest
SHA256 e8d16489c2615bda3d5bd3fd61e7ea4c49b3c5cde704e2024af8dd039471fdd6
MD5 d46eeb6f413ef988bdb3cf1d4ff177ec
BLAKE2b-256 62a01acb05d79583a542b6a8994f4746171c57fe014e7708a0fb036a73e3e4eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: composio_lyzr-0.6.8-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for composio_lyzr-0.6.8-py3-none-any.whl
Algorithm Hash digest
SHA256 770e960f9b4569fc43ab65bb61b73a59f188d7d82bd265c29b8aebc4c23245f5
MD5 93562e8cdb28911b60c525cb19b28bca
BLAKE2b-256 86e90918fcf6028f3d7f9b767c90e60dbc716f362582fd69dd23064f9ddc521b

See more details on using hashes here.

Supported by

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