import openai
from atp_sdk.clients import LLMClient
openai_client = openai.OpenAI(api_key="YOUR_OPENAI_API_KEY")
llm_client = LLMClient(api_key="YOUR_ATP_LLM_CLIENT_API_KEY")
# Get toolkit context
context = llm_client.get_toolkit_context(
toolkit_id="your_toolkit_id",
provider="openai",
user_prompt="Say hello to Alice."
)
# Generate tool calls
response = openai_client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Say hello to Alice."}
],
tools=context["tools"],
tool_choice="auto"
)
tool_calls = response.choices[0].message.tool_calls
# Execute tool calls
if tool_calls:
result = llm_client.call_tool(
toolkit_id="your_toolkit_id",
tool_calls=tool_calls,
provider="openai",
user_prompt="Say hello to Alice."
)
print(result)