Commit Graph

1 Commits

  • .NET: Fix role assignment in ChatMessage construction (#4290)
    * Use actual message role when creating ChatMessage
    
    Replace hard-coded ChatRole.User with a ChatRole constructed from the message's Role. The change ensures ToChatMessage and FunctionMessage use the original role (new ChatRole(this.Role)) for both text and contents branches, fixing incorrect role assignment when constructing ChatMessage instances.
    
    * Update changes
    
    * Fix formatting in ToChatMessage tests
    
    ---------
    
    Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>