Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions packages/junior/src/chat/respond.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
serializeGenAiAttribute,
setSpanAttributes,
setTags,
withLogContext,
withSpan,
type LogContext,
} from "@/chat/logging";
Expand Down Expand Up @@ -924,19 +925,21 @@ export async function generateAssistantReply(
} as PiMessage,
];

thinkingSelection = await selectTurnThinkingLevel({
completeObject,
conversationContext: context.conversationContext,
context: {
threadId: context.correlation?.threadId,
channelId: context.correlation?.channelId,
requesterId: context.correlation?.requesterId,
runId: context.correlation?.runId,
},
currentTurnBlocks: routerBlocks,
fastModelId: botConfig.fastModelId,
messageText: userInput,
});
thinkingSelection = await withLogContext(spanContext, () =>
selectTurnThinkingLevel({
completeObject,
conversationContext: context.conversationContext,
context: {
threadId: context.correlation?.threadId,
channelId: context.correlation?.channelId,
requesterId: context.correlation?.requesterId,
runId: context.correlation?.runId,
},
currentTurnBlocks: routerBlocks,
fastModelId: botConfig.fastModelId,
messageText: userInput,
}),
);
setSpanAttributes({
"gen_ai.request.model": botConfig.modelId,
"app.ai.reasoning_effort": thinkingSelection.thinkingLevel,
Expand Down
Loading