ChatResponseExtensions.RenderText(ChatResponse) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將所提供的 response 轉譯為 string。 回覆 string 可作為構建評估提示的一部分,以評估包含所提供 response內容的對話。
public:
[System::Runtime::CompilerServices::Extension]
static System::String ^ RenderText(Microsoft::Extensions::AI::ChatResponse ^ response);
public static string RenderText(this Microsoft.Extensions.AI.ChatResponse response);
static member RenderText : Microsoft.Extensions.AI.ChatResponse -> string
<Extension()>
Public Function RenderText (response As ChatResponse) As String
參數
- response
- ChatResponse
ChatResponse那個要被渲染的部分。
傳回
string包含渲染的 response。
備註
此函數僅考慮 ,Text忽略AIContent任何非 ContentsMessagesTextContents 的 s。 任何 Messages 不含 TextContents 的都會被跳過且不會被渲染。 如果沒有任何 包含 Messages 任何 TextContents,這個函式會回傳一個空字串。
渲染的 Messages 每組在回傳字串中都會加上 Role 和 AuthorName (如果有的話)。 渲染後 Messages的 s 也會在回傳字串中以新行字元分隔。