TechnologyNovember 15, 2023

Getting Started with the Astra Assistants API

Scott Regan
Scott ReganGrowth marketing
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"}]

)
Discover more
OpenAI
Share
JUMP TO SECTION

Get started

Coverage

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.