set_message Subroutine

private pure elemental subroutine set_message(this, role, content, name)

Type Bound

ChatCompletion_messages

Arguments

Type IntentOptional Attributes Name
class(ChatCompletion_messages), intent(inout) :: this
character(len=*), intent(in) :: role
character(len=*), intent(in) :: content
character(len=*), intent(in), optional :: name

Source Code

   elemental pure subroutine set_message(this, role, content, name)
      class(ChatCompletion_messages), intent(inout) :: this
      character(len=*),               intent(in)    :: role
      character(len=*),               intent(in)    :: content
      character(len=*), optional,     intent(in)    :: name
      this%role = trim(role)
      this%content = trim(content)
      if (present(name)) this%name = trim(name)
   end subroutine set_message