Forge documentation
Library referenceSwift

ForgeGenerate

Swift ForgeGenerate library product.

Swift ForgeGenerate library product.

Package contract

FieldValue
Languageswift
Source versionSwift package source snapshot
Manifestforge-swift/Package.swift
Source files4
EvidenceSource reference; registry publication and runtime conformance are separate checks

Import boundary

import ForgeGenerate

Use a source checkout or your verified private registry. Manifest coordinates identify the package; they do not establish that a public registry release exists.

Source reference

Download package reference JSON. Each original source file and generated declaration artifact has its own SHA-256 digest. Function bodies and constant values are omitted from downloads. These are source declaration inventories, not compiler-resolved rustdoc, TypeDoc, DocC, or Dokka output. Private modules can contain public declarations that are not reachable through the package boundary; consult the entry point before importing.

GenerateObject.swift

Read declaration text · 1 declaration entries

public func generateObject<T: Decodable & Sendable>(
model: any LanguageModel,
messages: [ModelMessage],
schema: JsonSchema,
type: T.Type,
options: GenerateOptions;

GenerateText.swift

Read declaration text · 2 declaration entries

public func generateText(
model: any LanguageModel,
messages: [ModelMessage],
tools: [ToolDefinition];

public func generateText(
model: any LanguageModel,
prompt: String,
system: String?;

StreamObject.swift

Read declaration text · 5 declaration entries

public struct PartialObjectChunk: Sendable

public let partialJson: String
/// Whether the object is complete and ready for decoding.
public let isComplete: Bool

public init(partialJson: String, isComplete: Bool)

public let isComplete: Bool

public init(partialJson: String, isComplete: Bool)

public init(partialJson: String, isComplete: Bool)

public func streamObject(
model: any LanguageModel,
messages: [ModelMessage],
schema: JsonSchema,
options: GenerateOptions;

StreamText.swift

Read declaration text · 3 declaration entries

public func streamText(
model: any LanguageModel,
messages: [ModelMessage],
tools: [ToolDefinition];

public func streamText(
model: any LanguageModel,
prompt: String,
system: String?;

public func collectStream(
_ stream: AsyncThrowingStream<StreamChunk, Error>
) async throws -> (text: String, finishReason: FinishReason, usage: Usage)

Continue

On this page