I think you would need to turn your beams perpendicular to the 2 end walls.
This would require 45° beams at each corner.
You would need to tie the ends together with more beams, but nail in hangers at the ends of the 45° beams wouldn't be strong. Some kind of custom brackets perhaps.
With this being a 2 story structure, it's best to consult an engineer.