Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions backend/src/ai-core/providers/langchain-openai.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { getOptionalEnvVariable, getRequiredEnvVariable } from '../../helpers/ap

@Injectable()
export class LangchainOpenAIProvider implements IAIProvider {
private readonly defaultModelId = 'gpt-4o';
private readonly responsesApiModel = 'gpt-4o';
private readonly defaultModelId = 'gpt-5';
private readonly responsesApiModel = 'gpt-5';
private openaiClient: OpenAI;

constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class RequestInfoFromTableWithAIUseCaseV5
extends AbstractUseCase<RequestInfoFromTableDSV2, void>
implements IRequestInfoFromTableV2
{
private readonly maxDepth: number = 5;
private readonly maxDepth: number = 10;
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubling maxDepth from 5 to 10 iterations could significantly increase API costs and response times. Each iteration involves an AI model call and potentially multiple database queries through tool execution. Consider the following:

  1. This doubles the maximum number of AI API calls per request (from 5 to 10)
  2. Each AI call incurs cost and latency
  3. Complex queries could now run up to 10 database operations in sequence

If this change is intentional to handle more complex queries, consider adding monitoring or logging to track how often the increased depth limit is actually needed in production. This would help validate whether the cost/performance tradeoff is justified.

Copilot uses AI. Check for mistakes.

constructor(
@Inject(BaseType.GLOBAL_DB_CONTEXT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class RequestInfoFromTableWithAIUseCaseV6
extends AbstractUseCase<RequestInfoFromTableDSV2, void>
implements IRequestInfoFromTableV2
{
private readonly maxDepth: number = 5;
private readonly maxDepth: number = 10;
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubling maxDepth from 5 to 10 iterations could significantly increase API costs and response times. Each iteration involves an AI model call and potentially multiple database queries through tool execution. Consider the following:

  1. This doubles the maximum number of AI API calls per request (from 5 to 10)
  2. Each AI call incurs cost and latency
  3. Complex queries could now run up to 10 database operations in sequence

If this change is intentional to handle more complex queries, consider adding monitoring or logging to track how often the increased depth limit is actually needed in production. This would help validate whether the cost/performance tradeoff is justified.

Suggested change
private readonly maxDepth: number = 10;
private readonly maxDepth: number = 5;

Copilot uses AI. Check for mistakes.
private readonly aiProvider: AIProviderType = AIProviderType.BEDROCK;

constructor(
Expand Down
Loading