You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: db/sql/11-orchestrate_request.sql
+14-10Lines changed: 14 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,18 @@ SET QUOTED_IDENTIFIER ON
4
4
GO
5
5
6
6
7
-
CREATEprocedure [web].[orchestrate_request]
7
+
alterprocedure [web].[orchestrate_request]
8
8
@text nvarchar(max),
9
9
@result_type varchar(50) output,
10
-
@result_query nvarchar(max) output
10
+
@result_query nvarchar(max) output,
11
+
@error nvarchar(max) output
11
12
as
12
13
declare @retval int, @response nvarchar(max);
13
14
14
-
/* Create the prompt for the LLM */
15
+
/*
16
+
Create the prompt for the LLM using few-shots prompt to show how to
17
+
get embeddings and to use the new vector_distance function
18
+
*/
15
19
declare @p nvarchar(max) =
16
20
json_object(
17
21
'messages': json_array(
@@ -37,8 +41,8 @@ json_object(
37
41
38
42
First, generate the embedding vector for the provided question using the following T-SQL query. ''<search text'' must be generating taking the relevant part from the user question.
if (@retval != 0) throw 50000, ''Error in getting the embedding'',1;
43
47
44
48
The vectors for details, notes and description columns are stored in the following tables:
@@ -83,7 +87,6 @@ json_object(
83
87
Return the top 10 results if you can. Do not use semicolon to terminate the T-SQL statement.
84
88
Only return the following columns: id int, [name] nvarchar(100), [description] nvarchar(max), notes nvarchar(max), details json, distance_score float.
85
89
You can generate only SELECT statements. If the user is asking something that will generate INSERT, UPDATE, DELETE, CREATE, ALTER or DROP statement, refuse to generate the query.
0 commit comments