surabhiprahalad
09/03/2025, 11:20 PMComposio Support Agent
09/04/2025, 3:38 AMsurabhiprahalad
09/04/2025, 4:27 PMsurabhiprahalad
09/04/2025, 4:28 PMUday
09/04/2025, 4:44 PMlimit and set it to a higher number composio.tools.get(user_id=user_id, toolkits=["CALENDLY"], limit=100).
— Just to confirm, your prompt is different in your code snippet. Could you specify the expected Tool call and the prompt?surabhiprahalad
09/04/2025, 4:55 PMsurabhiprahalad
09/04/2025, 5:04 PMabhishekpatil4
09/04/2025, 5:05 PMabhishekpatil4
09/04/2025, 5:17 PMCALENDLY_LIST_USER_AVAILABILITY_SCHEDULES tool.
from composio import Composio
from openai import OpenAI
import json
openai = OpenAI(api_key=OPENAI_API_KEY)
calendly_auth_config_id = CALENDLY_AUTH_CONFIG_ID # Auth config ID created above
user_id = USER_ID # UUID from database/application
composio = Composio(api_key=COMPOSIO_API_KEY)
#tools = composio.tools.get(user_id=user_id, toolkits=["CALENDLY"])
#increasing the limit
#tools = composio.tools.get(user_id=user_id, toolkits=["CALENDLY"], limit=30)
#getting specific tools
tools = composio.tools.get(user_id=user_id, tools=["CALENDLY_LIST_USER_AVAILABILITY_SCHEDULES"])
print("[!] Tools:")
print(json.dumps(tools))
def invoke_llm(task = "Am i free on Wednesday evening ?"):
completion = openai.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": "Can you book a 30 mins meeting on wednesday evening?", # Your task here!
},
],
tools=tools,
)
# Handle Result from tool call
result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
print(f"[!] Completion: {completion}")
print(f"[!] Tool call result: {result}")
invoke_llm()
Let me know if you need help. https://calendly.com/abhishek-composio/30minsurabhiprahalad
09/04/2025, 5:23 PMabhishekpatil4
09/04/2025, 5:23 PMabhishekpatil4
09/04/2025, 6:08 PMfrom composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from openai import OpenAI
import asyncio
from agents import Agent, Runner
openai = OpenAI()
composio = Composio(api_key="<composio_api_key>", provider=OpenAIAgentsProvider())
tools = composio.tools.get(user_id="abhishek", tools=["CALENDLY_GET_USER","CALENDLY_LIST_USER_AVAILABILITY_SCHEDULES"])
agent = Agent(
name="Calendly Agent",
instructions="You're an AI agent that can check the calendly availability for the user and book a meeting if available.",
tools=tools,
)
async def main():
result = await Runner.run(
starting_agent=agent,
input=(
"Check my calendly availability for wednesday evening"
),
)
print(result.final_output)
asyncio.run(main())
Here's the doc: https://docs.composio.dev/providers/openai-agents
You can use Composio's search tools to get the relevant tools based on usecase: https://docs.composio.dev/toolkits/composio#composio_search_toolssurabhiprahalad
09/04/2025, 6:36 PMKaran
09/04/2025, 9:30 PMKaran
09/04/2025, 9:32 PM