Skip to content

Conversation

@Artuomka
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings January 23, 2026 13:52
@Artuomka Artuomka enabled auto-merge January 23, 2026 13:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the AI model identifier from 'gpt-4o' to 'gpt-5' in the OpenAI provider and increases the maximum recursion depth (maxDepth) from 5 to 10 in AI use case implementations v5 and v6.

Changes:

  • Updated defaultModelId and responsesApiModel from 'gpt-4o' to 'gpt-5' in LangchainOpenAIProvider
  • Increased maxDepth from 5 to 10 in RequestInfoFromTableWithAIUseCaseV5
  • Increased maxDepth from 5 to 10 in RequestInfoFromTableWithAIUseCaseV6

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
backend/src/ai-core/providers/langchain-openai.provider.ts Updates AI model identifiers to 'gpt-5'
backend/src/entities/ai/use-cases/request-info-from-table-with-ai-v5.use.case.ts Doubles the maximum tool-calling loop depth from 5 to 10
backend/src/entities/ai/use-cases/request-info-from-table-with-ai-v6.use.case.ts Doubles the maximum tool-calling loop depth from 5 to 10

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
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.
@Artuomka Artuomka merged commit 67e11f7 into main Jan 23, 2026
25 checks passed
@Artuomka Artuomka deleted the backend_langchain branch January 23, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants