Skip to content

docs: document Pipeline DSL with cross-platform code examples #14

@hyochan

Description

@hyochan

Problem/Opportunity

The Pipeline DSL is one of Locanara's most differentiating "framework" features — yet it has no documentation anywhere in packages/site/, docs/, or the README beyond brief mentions in CLAUDE.md. Developers discovering the SDK won't know this feature exists.

Both iOS and Android have fully implemented Pipeline.swift / Pipeline.kt and ModelExtensions, enabling type-safe multi-step AI pipelines:

// Swift — compiler tracks output type through each step
try await model.pipeline { Proofread(); Translate(to: "ko") }.run("text")
// Kotlin — same type-safety
model.pipeline { proofread(); translate(to = "ko") }.run("text")

There are no code examples in the site, README, or example apps showing:

  • How to compose multi-step pipelines
  • The compile-time type-safety guarantees
  • Convenience extensions (.summarize(), .translate())
  • Comparison of the 3 API levels: Simple / Chain / Custom
  • Web SDK note: no Pipeline builder — use per-feature streaming methods instead

Proposed Solution

  1. Add a Pipeline DSL guide to packages/site/src/ covering:
    • Motivation: why pipelines vs raw generate() calls
    • Side-by-side Swift + Kotlin examples of composing chains
    • Type-safety explanation
    • Custom Chain implementation walkthrough (implement Chain protocol)
    • Web SDK note: available via summarizeStreaming etc., no pipeline builder
  2. Update README to feature Pipeline DSL in the "Three Levels of API" section with real code snippets
  3. Add pipeline demo screens to example apps:
    • packages/apple/Example/ — PipelineDemoView.swift
    • packages/android/example/ — PipelineDemoActivity.kt

Affected Files

  • packages/site/src/ — new guide page
  • README.md — add pipeline examples
  • packages/apple/Example/ — PipelineDemoView.swift
  • packages/android/example/ — PipelineDemoActivity.kt

Priority

Medium — High discoverability impact for a flagship framework feature

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions