A prosecuting attorney and an attorney for a defendant or a defendant when acting pro se may engage in discussions, with a view toward reaching an agreement that, upon the entering of a plea of guilty or nolo contendere to a charged offense or to a lesser or related offense, the prosecuting attorney will do any one or more of the following:
A court shall not participate in such discussions. The prosecuting attorney shall make a reasonable effort to provide each victim of a crime of violence or an offense pursuant to chapter 22-22, his designee, or closest next of kin if victim is deceased, of the defendant's crime with an opportunity to comment on the terms of the plea agreement to the prosecuting attorney. If the victim is a minor, the victim's parent or guardian may comment on the terms of the plea agreement to the prosecuting attorney.
SDCL 23A-7-8