Skip to content

ContentParts

Namespace: Vercel.AI.GenerateText

public static class ContentParts

Reads text and reasoning out of generated content. Maps to extractTextContent and extractReasoningContent.

Inheritance: object

View source

ExtractReasoningContent(IReadOnlyList<GeneratedContent>?)

Section titled “ExtractReasoningContent(IReadOnlyList<GeneratedContent>?)”
public static string? ExtractReasoningContent(IReadOnlyList<GeneratedContent>? content)

Joins reasoning parts with newlines. Returns null when there are none.

Parameters

Name Type Description
content IReadOnlyList<GeneratedContent>

Returns: string

View source

ExtractTextContent(IReadOnlyList<GeneratedContent>?)

Section titled “ExtractTextContent(IReadOnlyList<GeneratedContent>?)”
public static string? ExtractTextContent(IReadOnlyList<GeneratedContent>? content)

Joins text parts. Returns null when there are none.

Parameters

Name Type Description
content IReadOnlyList<GeneratedContent>

Returns: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product