We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from openai import OpenAI from composio_openai import ComposioToolSet, App, Action
openai_client = OpenAI( api_key="{{OPENAIKEY}}" )
composio_tool_set = ComposioToolSet()
actions = composio_tool_set.get_actions( actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER] )
my_task = "Star a repo composiodev/composio on GitHub"
assistant_instruction = "You are a super intelligent personal assistant"
assistant = openai_client.beta.assistants.create( name="Personal Assistant", instructions=assistant_instruction, model="gpt-4-turbo", tools=actions, )
thread = openai_client.beta.threads.create()
message = openai_client.beta.threads.messages.create( thread_id=thread.id, role="user", content=my_task )
run = openai_client.beta.threads.runs.create( thread_id=thread.id, assistant_id=assistant.id )
response_after_tool_calls = composio_tool_set.wait_and_handle_assistant_tool_calls( client=openai_client, run=run, thread=thread, )
print(response_after_tool_calls)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
from openai import OpenAI
from composio_openai import ComposioToolSet, App, Action
openai_client = OpenAI(
api_key="{{OPENAIKEY}}"
)
Initialise the Composio Tool Set
composio_tool_set = ComposioToolSet()
Get GitHub tools that are pre-configured
actions = composio_tool_set.get_actions(
actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER]
)
my_task = "Star a repo composiodev/composio on GitHub"
Setup openai assistant
assistant_instruction = "You are a super intelligent personal assistant"
assistant = openai_client.beta.assistants.create(
name="Personal Assistant",
instructions=assistant_instruction,
model="gpt-4-turbo",
tools=actions,
)
create a thread
thread = openai_client.beta.threads.create()
message = openai_client.beta.threads.messages.create(
thread_id=thread.id,
role="user",
content=my_task
)
Execute Agent with integrations
run = openai_client.beta.threads.runs.create(
thread_id=thread.id,
assistant_id=assistant.id
)
Execute Function calls
response_after_tool_calls = composio_tool_set.wait_and_handle_assistant_tool_calls(
client=openai_client,
run=run,
thread=thread,
)
print(response_after_tool_calls)
The text was updated successfully, but these errors were encountered: