8000 improved code layout · lkmodise/azure-sql-db-openai@6f407c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f407c4

Browse files
committed
improved code layout
1 parent b23c3f1 commit 6f407c4

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

vector-embeddings/04-sample-function.sql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,3 @@ from
4141
inner join
4242
dbo.wikipedia_articles_embeddings a on r.article_id = a.id
4343
go
44-
45-
/*
46-
Test the function
47-
*/
48-
declare @response nvarchar(max);
49-
declare @payload nvarchar(max) = json_object('input': 'the foundation series by isaac asimov');
50-
51-
exec sp_invoke_external_rest_endpoint
52-
@url = 'https:/<your-app-name>.openai.azure.com/openai/deployments/embeddings/embeddings?api-version=2023-03-15-preview',
53-
@credential = [https://<your-app-name>.openai.azure.com],
54-
@payload = @payload,
55-
@response = @response output;
56-
57-
select * from dbo.SimilarContentArticles(json_query(@response, '$.result.data[0].embedding')) as r order by cosine_distance desc
58-
go
Lines changed: 14 additions & 0 deletions
+
/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1
2+
Test the function
3+
*/
4+
declare @response nvarchar(max);
5+
declare @payload nvarchar(max) = json_object('input': 'the foundation series by isaac asimov');
6+
7+
exec sp_invoke_external_rest_endpoint
8+
@url = 'https://<your-app-name>.openai.azure.com/openai/deployments/embeddings/embeddings?api-version=2023-03-15-preview',
9+
@credential = [https://<your-app-name>.openai.azure.com],
10+
@payload = @payload,
11+
@response = @response output;
12+
13+
select * from dbo.SimilarContentArticles(json_query(@response, '$.result.data[0].embedding')) as r order by cosine_distance desc
14+
go

0 commit comments

Comments
 (0)
0