File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change 41
41
inner join
42
42
dbo .wikipedia_articles_embeddings a on r .article_id = a .id
43
43
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
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments