dkushari
Databricks Employee
Databricks Employee

Hi @tefrati - Can you please go to the model serving endpoint and click on the use drop down (as shown in the picture below) and try the simple python or sql and see if that works for you.

from openai import OpenAI
import os

# How to get your Databricks token: https://docs.databricks.com/en/dev-tools/auth/pat.html
DATABRICKS_TOKEN = os.environ.get('DATABRICKS_TOKEN')
# Alternatively in a Databricks notebook you can use this:
# DATABRICKS_TOKEN = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiToken().get()

client = OpenAI(
  api_key=DATABRICKS_TOKEN,
  base_url="https://e2-demo-field-eng.cloud.databricks.com/serving-endpoints"
)

embeddings = client.embeddings.create(
  input='Your string for the embedding model goes here',
  model="databricks-bge-large-en"
)

print(embeddings.data[0].embedding)

dkushari_0-1760806801038.png

SELECT ai_query('databricks-bge-large-en',
    request => "<Please provide your input string here!>")