Skip to content

CGC-160 | filter out hallunciated areas

What does this MR do and why?

At a point in time the AI was adding areas beyond our outline criteria. The models have improved so I see this happening less, so much so that I had to adjust the system prompt to even get back an outside label as you can see here (this is a quick hack and was removed after testing):

Screenshot_2025-10-16_at_11.14.30_AM

It worked and we were able to implement the filter_response method to remove any unwanted areas.

Additionally, linting required us to decrease class size so it made sense to create a prompt building service class.

References

#160

A few additional notes

  1. I had to include an Anthropic API key and while I have one, I am kind of opposed to closed source models that require payment in something like this project.
  2. It yelled at me and wanted an anthropic-version header, so I had to add that in for testing but removed as it appears to be working fine in production. Let me know if you have faced this issue and we can get it documented for people working with LLM features.

/cc @leetickett-gitlab

Edited by Max Brundige

Merge request reports

Loading