Skip to main content

Use Composio to get an array of tools with your Together AI Function Call.

Project description

🚀🔗 Leveraging Together AI with Composio

Facilitate the integration of Together AI with Composio to empower open source models to directly interact with external applications, broadening their capabilities and application scope.

Objective

  • Automate starring a GitHub repository using conversational instructions via Together AI 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-togetherai

# Connect your GitHub account
composio add github

# View available applications you can connect with
composio apps

### Usage Steps

#### 1. Import Base Packages

Prepare your environment by initializing necessary imports from OpenAI and setting up your client.

```python
from together import Together

# Initialize OpenAI client
client = Together(api_key="<together-ai-api-key>")

Step 2: Integrating GitHub Tools with Composio

This step involves fetching and integrating GitHub tools provided by Composio, enabling enhanced functionality for LangChain operations.

from composio_togetherai import Action, ComposioToolSet, App


toolset = ComposioToolSet()
actions = toolset.get_tools(apps=[App.GITHUB])

Step 3: Agent Execution

This step involves configuring and executing the agent to carry out actions, such as starring a GitHub repository.

my_task = "Star a repo composiohq/composio on GitHub"

# Create a chat completion request to decide on the action
response = client.chat.completions.create(model="gpt-4o",
    tools=actions, # Passing actions we fetched earlier.
    messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": my_task}
        ]
    )

print(response)

Step 4: Validate Execution Response

Execute the following code to validate the response, ensuring that the intended task has been successfully completed.

result = toolset.handle_tool_calls(response)
pprint(result)

Project details


Download files

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

Source Distribution

composio_togetherai-0.7.6.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

composio_togetherai-0.7.6-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file composio_togetherai-0.7.6.tar.gz.

File metadata

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

File hashes

Hashes for composio_togetherai-0.7.6.tar.gz
Algorithm Hash digest
SHA256 49c804970070d91592389cf0d42b1d441527cd50d70af08a03b19a6e2bef832c
MD5 8d1fce419369977d4de4c1b4174d7098
BLAKE2b-256 ac0f6187c3db44f252aefc4b4ae68042b9c576664e3ea6fa3d90f936d0a0a1ac

See more details on using hashes here.

File details

Details for the file composio_togetherai-0.7.6-py3-none-any.whl.

File metadata

File hashes

Hashes for composio_togetherai-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a88322246824ae615460f31d2ff6ffadd32fa653ad1a3e45611e4129e1d6058f
MD5 518887f8147a7f28dc935330198c270b
BLAKE2b-256 e32d67038936f4aa03da71db9b32e9bac2046bb44cf55442799a57c2a440792f

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