tests/integration/create_assistant_with_platform_tools.py
Rama main · réplica de lectura del repositorio original.
""" """
import os
from dotenv import load_dotenv
from projectdavid import Entity
# ------------------------------------------------------------------
# 0. SDK init + env
# ------------------------------------------------------------------
load_dotenv()
client = Entity(
api_key=os.getenv("ENTITIES_API_KEY"),
)
# -------------------------------------------
# create_assistant
# --------------------------------------------
assistant = client.assistants.create_assistant(
name="Test Assistant",
model="gpt-oss-120b",
instructions="You are a helpful AI assistant, your name is Test.",
tools=[
{"type": "code_interpreter"},
{"type": "computer"},
{"type": "file_search"},
{"type": "web_search"},
{
"type": "function",
"function": {
"name": "get_flight_times",
"description": "Get flight times",
"parameters": {
"type": "object",
"properties": {
"departure": {"type": "string"},
"arrival": {"type": "string"},
},
"required": ["departure", "arrival"],
},
},
},
],
)
print(assistant.id)
print(assistant.tools)