Skip to content

Trim file content for code generation prompt

Jan Provaznik requested to merge jp-prompt-limit into master

What does this MR do and why?

Trim file content for code generation prompt

There is a correlation between size of the prompt and duration of request. To avoid excessively running requests much smaller content limit is used (50000 chars).

This change is introduced behind a feature flag so we can test this first on a subset of users first (perhaps gitlab internal users).

Related to https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/issues/362

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Jan Provaznik

Merge request reports