File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,9 +32,6 @@ export async function handle(
3232 'あなたは文書からコンテキストを取得する専門家です。ツールを使用してユーザーの質問に答える手助けをしてください。必ずユーザーの質問と同じ言語で答えてください。' ;
3333
3434 const { platform, model, modelName } = selectLlm ( modelType ) ;
35-
36- const agent = createAgent ( { model, tools : [ tool ] , systemPrompt } ) ;
37-
3835 // Initialize Langfuse callback handler
3936 const langfuseHandler = langfuse . publicKey && langfuse . secretKey ? new CallbackHandler ( {
4037 sessionId,
@@ -43,6 +40,12 @@ export async function handle(
4340 tags : [ modelName ] ,
4441 } ) : undefined ;
4542
43+ const agent = createAgent ( {
44+ model,
45+ tools : [ tool ] ,
46+ systemPrompt,
47+ } ) ;
48+
4649 logger . debug ( `Langfuse: ${ langfuseHandler ? 'enable' : 'disable' } ` ) ;
4750
4851 const threadId = uuidv7 ( ) ;
@@ -54,8 +57,8 @@ export async function handle(
5457 configurable : {
5558 sessionId,
5659 thread_id : threadId ,
57- callbacks : langfuseHandler ? [ langfuseHandler ] : [ ] ,
5860 } ,
61+ callbacks : langfuseHandler ? [ langfuseHandler ] : [ ] ,
5962 } ,
6063 ) ;
6164 for await ( const sEvent of stream ) {
You can’t perform that action at this time.
0 commit comments