Support for Databricks AI support with OpenAI
Project description
Databricks OpenAI Integration
The databricks-openai package provides seamless integration of Databricks AI features into OpenAI applications.
Installation
From PyPI
pip install databricks-openai
From Source
pip install git+https://git@github.com/databricks/databricks-ai-bridge.git#subdirectory=integrations/openai
Key Features
- Vector Search: Store and query vector representations using
VectorSearchRetrieverTool.
Getting Started
Use Vector Search on Databricks
# Step 1: call model with VectorSearchRetrieverTool defined
dbvs_tool = VectorSearchRetrieverTool(index_name="catalog.schema.my_index_name")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": "Using the Databricks documentation, answer what is Spark?"
}
]
first_response = client.chat.completions.create(
model="gpt-4o",
messages=messages,
tools=[dbvs_tool.tool]
)
# Step 2: Execute function code – parse the model's response and handle function calls.
tool_call = first_response.choices[0].message.tool_calls[0]
args = json.loads(tool_call.function.arguments)
result = dbvs_tool.execute(query=args["query"]) # For self-managed embeddings, optionally pass in openai_client=client
# Step 3: Supply model with results – so it can incorporate them into its final response.
messages.append(first_response.choices[0].message)
messages.append({
"role": "tool",
"tool_call_id": tool_call.id,
"content": json.dumps(result)
})
second_response = client.chat.completions.create(
model="gpt-4o",
messages=messages,
tools=tools
)
Contribution Guide
We welcome contributions! Please see our contribution guidelines for details.
License
This project is licensed under the MIT License.
Thank you for using Databricks OpenAI!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file databricks_openai-0.10.0.tar.gz.
File metadata
- Download URL: databricks_openai-0.10.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94af1af16ea17e6236990dcef49ec2e81242c1fedc2943a43647933c95aa38cf
|
|
| MD5 |
2c85675bc35e4a4b7f042884670f1451
|
|
| BLAKE2b-256 |
cf676ad571eb1dd05fd998fa7e797ba37435d057ebb64091e95d37bcf952aaa6
|
Provenance
The following attestation bundles were made for databricks_openai-0.10.0.tar.gz:
Publisher:
release-databricks-openai.yml on databricks/databricks-ai-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
databricks_openai-0.10.0.tar.gz -
Subject digest:
94af1af16ea17e6236990dcef49ec2e81242c1fedc2943a43647933c95aa38cf - Sigstore transparency entry: 869122922
- Sigstore integration time:
-
Permalink:
databricks/databricks-ai-bridge@86050a003e00653a0be4cde60b7768d41af2176d -
Branch / Tag:
refs/tags/databricks-openai-v0.10.0 - Owner: https://github.com/databricks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-databricks-openai.yml@86050a003e00653a0be4cde60b7768d41af2176d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file databricks_openai-0.10.0-py3-none-any.whl.
File metadata
- Download URL: databricks_openai-0.10.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25e48e73074af1f3a553191879324733612a17e0b52b1476a9801b2b2714817c
|
|
| MD5 |
147a43ece59a471f36961db295cc4c6e
|
|
| BLAKE2b-256 |
282476d90ba42342520f209ec9b9c7ae204fd808a602b02c1b2996443882d330
|
Provenance
The following attestation bundles were made for databricks_openai-0.10.0-py3-none-any.whl:
Publisher:
release-databricks-openai.yml on databricks/databricks-ai-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
databricks_openai-0.10.0-py3-none-any.whl -
Subject digest:
25e48e73074af1f3a553191879324733612a17e0b52b1476a9801b2b2714817c - Sigstore transparency entry: 869122949
- Sigstore integration time:
-
Permalink:
databricks/databricks-ai-bridge@86050a003e00653a0be4cde60b7768d41af2176d -
Branch / Tag:
refs/tags/databricks-openai-v0.10.0 - Owner: https://github.com/databricks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-databricks-openai.yml@86050a003e00653a0be4cde60b7768d41af2176d -
Trigger Event:
workflow_dispatch
-
Statement type: