Skip to content

SwiftOpenAI v4.1.1

Compare
Choose a tag to compare
@jamesrochabrun jamesrochabrun released this 13 May 06:47
· 34 commits to main since this release

Update Read me for Anthropic OpenAI compatibility

Anthropic

Anthropic provides OpenAI compatibility, for more, visit the documentation

To use Claude models with SwiftOpenAI you can.

let anthropicApiKey = ""
let openAIService = OpenAIServiceFactory.service(apiKey: anthropicApiKey, 
                     overrideBaseURL: "https://api.anthropic.com", 
                     overrideVersion: "v1")

Now you can create the completio parameters like this:

let parameters = ChatCompletionParameters(
   messages: [.init(
   role: .user,
   content: "Are you Claude?")],
   model: .custom("claude-3-7-sonnet-20250219"))

What else

New Contributors

Full Changelog: v4.1.0...v4.1.1