Skip to main content

Use Composio to get an array of tools with your Julep wokflow.

Project description

🚀🔗 Integrating Composio with Julep

Streamline the integration of Composio within the Julep agentic framework to enhance the interaction capabilities of Julep agents with external applications, significantly extending their operational range and efficiency.

Objective

  • Facilitate the automation of starring a GitHub repository through the use of conversational commands within the Julep framework, leveraging Composio's OpenAI Function Calls.

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-openai

# Connect your GitHub account
composio-cli add github

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

Usage Steps

1. Initialize Environment and Client

Set up your development environment by importing essential libraries and configuring the Julep client.

import os
import textwrap
from julep import Client
from dotenv import load_dotenv


load_dotenv()

api_key = os.environ["JULEP_API_KEY"]
base_url = os.environ["JULEP_API_URL"]
# openai_api_key = os.environ["OPENAI_API_KEY"]

client = Client(api_key=api_key, base_url=base_url)



name = "Jessica"
about = "Jessica is a forward-thinking tech entrepreneur with a sharp eye for disruptive technologies. She excels in identifying and nurturing innovative tech startups, with a particular interest in sustainability and AI."
default_settings = {
    "temperature": 0.7,
    "top_p": 1,
    "min_p": 0.01,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "length_penalty": 1.0,
    "max_tokens": 150,
}

2. Integrating GitHub Tools with Composio for LangChain Operations

This section guides you through the process of integrating GitHub tools into your LangChain projects using Composio's services.

from composio_julep import App, ComposioToolSet
    
toolset = ComposioToolSet()
composio_tools = toolset.get_tools(tools=App.GITHUB)


agent = client.agents.create(
    name=name,
    about=about,
    default_settings=default_settings,
    model="gpt-4-turbo",
    tools=composio_tools,
)

Step 3: Agent Execution

This step involves configuring and executing the agent to carry out specific tasks, for example, starring a GitHub repository.

about = """
Sawradip, a software developer, is passionate about impactful tech. 
At the tech fair, he seeks investors and collaborators for his project.
"""
user = client.users.create(
    name="Sawradip",
    about=about,
)

situation_prompt = """You are Jessica, a key figure in the tech community, always searching for groundbreaking technologies. At a tech fair filled with innovative projects, your goal is to find and support the next big thing.

Your journey through the fair is highlighted by encounters with various projects, from groundbreaking to niche. You believe in the power of unexpected innovation.

Recent Tweets
1. 'Amazed by the tech fair's creativity. The future is bright. #TechInnovation'
2. 'Met a developer with a transformative tool for NGOs. This is the
"""

session = client.sessions.create(
    user_id=user.id, agent_id=agent.id, situation=situation_prompt
)

user_msg = "Hi, I am presenting my project, hosted at github repository composiohq/composio. If you like it, adding a star would be helpful "

# user_msg = "What do you like about tech?"

response = client.sessions.chat(
    session_id=session.id,
    messages=[
        {
            "role": "user",
            "content": user_msg,
            "name": "Sawradip",
        }
    ],
    recall=True,
    remember=True,
)

pprint(response)

Step 4: Validate Response

Execute and validate the response to ensure the task was completed successfully.

execution_output = toolset.handle_tool_calls(response)
print(execution_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_julep-0.5.40.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

composio_julep-0.5.40-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file composio_julep-0.5.40.tar.gz.

File metadata

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

File hashes

Hashes for composio_julep-0.5.40.tar.gz
Algorithm Hash digest
SHA256 bedee0ba78e2c4c161fa8e86d33dba1cfd04722c4d41f0b75df4a5b70e19d47d
MD5 26ac089703fde4154901175e9214cdc4
BLAKE2b-256 9d1e8ffa8f29307b717ffb3984c33c939ed712f7ca205279f251df06fed0742a

See more details on using hashes here.

File details

Details for the file composio_julep-0.5.40-py3-none-any.whl.

File metadata

File hashes

Hashes for composio_julep-0.5.40-py3-none-any.whl
Algorithm Hash digest
SHA256 67f0b0e855f3ba6d693e4dd38da98b1e5b754112822af2be28f15136c010cf83
MD5 71558f3c1d53c80b7ff3db89dd2b1311
BLAKE2b-256 33db1dcf73b259b6c84cc3121306b7b40e8fb7f090ef96e8e0e6b6d8eeea8db4

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