Skip to content

Limit the number of libraries to be included in prompt

Summary

The current code generation diagram [as of 2024-10-22] indicates that a limit of 50 entities from the Xray Report are included the prompt. But in fact we haven't enforced this limit in GitLab nor in the deprecated Repository X-Ray Go repository.

On projects that have several 100s of dependencies (some have over 1000 per config file), this means that the Code Generation prompt we send to the LLM could be unusually large and/or significantly truncated.

Proposal

Use only the first X number of libraries from the xray_report. This should be updated in both the legacy prompt (anthropic_messages.rb) as well as in the libraries parameter that we send to AIGW (ai_gateway_messages.rb).

Convey this limit in the customer docs and the handbook.

Edited by Leaminn Ma