print_user_message Subroutine

private impure elemental subroutine print_user_message(this)

Uses

    • face
  • proc~~print_user_message~~UsesGraph proc~print_user_message foropenai_ChatCompletion::ChatCompletion%print_user_message face face proc~print_user_message->face

Type Bound

ChatCompletion

Arguments

Type IntentOptional Attributes Name
class(ChatCompletion), intent(inout) :: this

Calls

proc~~print_user_message~~CallsGraph proc~print_user_message foropenai_ChatCompletion::ChatCompletion%print_user_message colorize colorize proc~print_user_message->colorize

Called by

proc~~print_user_message~~CalledByGraph proc~print_user_message foropenai_ChatCompletion::ChatCompletion%print_user_message program~test_chatcompletion test_ChatCompletion program~test_chatcompletion->proc~print_user_message

Source Code

   elemental impure subroutine print_user_message(this)
      use face, only: colorize
      class(ChatCompletion), intent(inout) :: this
      integer                              :: i
      do i = 1, size(this%messages)
         if (this%messages(i)%role == 'user') then
            print "(A,': ',A)", colorize(trim(this%user_name), color_bg='green'), this%messages(i)%content
         end if
      end do
   end subroutine print_user_message