SwiftClaude

I'm excited to share a side-project I've been working on!

While this package supports all the standard "stream text from an LLM" functionality, it also support for letting Claude call back into Swift code via tool use.
So you can write something like following and Claude will be able to call the invoke function from a response!

@Tool
struct TurboEncabulator {

  /// Turbo-encabulates its input
  /// - Parameters:
  ///   - marzlevaneCount: the number of marzlevanes to use when turbo-encabulating
  func invoke(
    marzlevaneCount: Int
  ) {
    …
  }

}

This package is built with bleeding-edge Swift, and I'll also be posting a follow up post highlighting some of the interesting stuff, like reinventing Codable and mastering withObservationTracking. UPDATE: posted here.

5 Likes