To be, or not to be calls itself a soliloquy. Peculiarly, footnote "a" says "Though it is called a soliloquy, Hamlet is not alone [because Ophelia is also on stage]". I don't know why this note is necessary, because
most soliloqies I can think of happen while other actors are doing unimportant little things in the background, or stand frozen in time