Technology•November 15, 2023
Getting Started with the Astra Assistants API

client = OpenAI()
client = OpenAI(
base_url="https://open-assistant-ai.astra.datastax.com/v1",
default_headers={
"astra-api-token": <YOUR_ASTRA_DB_TOKEN>
}
)
client = OpenAI(
base_url="https://open-assistant-ai.astra.datastax.com/v1",
default_headers={
"astra-api-token": <YOUR_ASTRA_DB_TOKEN>,
"astra-db-id": <YOUR_ASTRA_DB_ID>
}
)
assistant = client.beta.assistants.create(
instructions="You are a personal math tutor. When asked a math question, write and run code to answer the question.",
model="gpt-4-1106-preview",
tools=[{"type": "code_interpreter"}]
)