8000 added auth details · Bubby2015/azure-sql-db-openai@269afbe · GitHub
[go: up one dir, main page]

Skip to content

Commit 269afbe

Browse files
committed
added auth details
1 parent b25a5f5 commit 269afbe

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

python/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,34 @@ In this sample the local model [multi-qa-MiniLM-L6-cos-v1](https://huggingface.c
99
- use [Fulltext search in Azure SQL database with BM25 ranking](https://learn.microsoft.com/en-us/sql/relational-databases/search/limit-search-results-with-rank?view=sql-server-ver16#ranking-of-freetexttable)
1010
- do re-ranking applying Reciprocal Rank Fusion (RRF) to combine the BM25 ranking with the cosine similarity ranking
1111

12-
Make sure to setup the database for this sample using the `./python/00-setup-database.sql` script. Database can be either an Azure SQL DB or a SQL Server database.
12+
Make sure to setup the database for this sample using the `./python/00-setup-database.sql` script. Database can be either an Azure SQL DB or a SQL Server database. Once the database has been created, you can run the `./python/hybrid_search.py` script to do the hybrid search:
13+
14+
First, set up the virtual environment and install the required packages:
15+
16+
```bash
17+
python -m venv .venv
18+
```
19+
20+
Activate the virtual environment and then install the required packages:
21+
22+
```bash
23+
pip install -r requirements.txt
24+
```
25+
26+
Create an environment file `.env` with the connection string to Azure SQL database. You can use the `.env.sample` as a starting point. The sample `.env` file shows how to use Entra ID to connect to the database, which looks like:
27+
28+
```text
29+
MSSQL='Driver={ODBC Driver 18 for SQL Server};Server=tcp:<server>,1433;Database=<database>;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30'
30+
```
31+
32+
If you want to use SQL Authentication the connection string would instead look like the following:
33+
34+
```
35+
MSSQL='Driver={ODBC Driver 18 for SQL Server};Server=tcp:<server>,1433;Database=<database>;UID=<user>;PWD=<password>;Encrypt=yes;TrustServerCertificate=yes;Connection Timeout=30'
36+
```
37+
38+
Then run the script:
39+
40+
```bash
41+
python hybrid_search.py
42+
```

0 commit comments

Comments
 (0)
0