File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change @@ -9,35 +9,11 @@ const langbase = new Langbase({
99
1010export async function POST ( req : NextRequest ) {
1111 const options = await req . json ( ) ;
12- console . log ( "🚀 ~ options:" , options )
13-
14- const { completion } = await langbase . pipes . run ( {
15- name : 'query-rewrite' ,
16- messages : [
17- {
18- role : 'user' ,
19- content : options . messages [ options . messages . length - 1 ] . content ,
20- } ,
21- ] ,
22- stream : false
23- } ) ;
24- console . log ( "🚀 ~ completion:" , completion )
25-
26-
27- // Parse the completion to get the rewritten query
28- const rewrittenQuery = JSON . parse ( completion ) . rewrittenQuery ;
29- console . log ( "🚀 ~ rewrittenQuery:" , rewrittenQuery )
12+ // console.log("🚀 ~ options:", options)
3013
3114 // Create a new options object with the rewritten query
3215 const updatedOptions = {
3316 ...options ,
34- messages : [
35- ...options . messages . slice ( 0 , - 1 ) , // Keep all messages except the last one
36- {
37- role : 'user' ,
38- content : rewrittenQuery
39- }
40- ] ,
4117 name : 'ask-sourcegraph-docs' ,
4218 lastMessageOnly : true ,
4319 } ;
You can’t perform that action at this time.
0 commit comments