Repository navigation
5.0.0
Fixed
generateWithUsageandgeneraterecursed forever on every cloud client. Both were
unreachable at run time onAnthropicClient,GeminiClient,OpenAIClient,DeepSeekClient,
GroqClient,MistralClient,OpenRouterClientandXAIClient— a call never returned, and
the process grew until it was killed. The requirement in llm-client 3.x took
systemPrompt: SystemPrompt?while every implementation here declaredsystemPrompt: String?,
so none of them witnessed it. The convenience method beside the requirement — same signature,
optional arguments defaulted — witnessed it instead and called straight back into itself. It
compiled, and no test called either method, so nothing ever said so. llm-client 4.0.0 gives the
requirement a distinct signature, which turned this into a compile error and is how it was
found. Confirmed against 3.13.0 in a throwaway package: 85 GB of memory before the kernel
killed it, with neither implementation ever entered.
Removed
-
BREAKING — the methods that implement llm-client's protocol requirements now take an options
value instead of a list of optional arguments, following llm-client 4.0.0. Gone from the
public API:Type Removed AnthropicClient,GeminiClientgenerateWithUsage(input:model:systemPrompt:temperature:maxTokens:),generateWithUsage(messages:model:systemPrompt:temperature:maxTokens:),chat(messages:model:systemPrompt:temperature:maxTokens:)OpenAIClient,DeepSeekClient,GroqClient,MistralClient,OpenRouterClient,XAIClientthe same three, inherited from OpenAICompatibleClientProtocolGeminiClient,OpenAIClientgenerateImage(input:model:size:quality:format:n:),generateImages(input:model:size:quality:format:n:),startVideoGeneration(input:model:duration:aspectRatio:resolution:)OpenAIClientgenerateSpeech(input:model:voice:speed:format:)Each is replaced by a form taking
GenerationOptions,ChatOptions,ImageGenerationOptions,
VideoGenerationOptionsorSpeechGenerationOptions.Most call sites need no change. llm-client still supplies the same argument lists as
convenience methods with defaults, soclient.generateImage(input:, model:, size: .square1024)
andclient.chat(messages:, model:, systemPrompt: "…")still compile and now reach a real
implementation. What breaks is passing aStringvariable asgenerateWithUsage's system
prompt: the surviving overload takesSystemPrompt, which a string literal converts to but a
Stringdoes not — wrap it asSystemPrompt(stringLiteral: text)or pass the literal directly.
Code that conformed its own type to these protocols by forwarding to a cloud client must adopt
the options-taking signatures too, or it will no longer conform.
Changed
- Raised the floors to llm-client 4.0.0, swift-structured-data 3.0.0 and swift-api-client 3.0.3,
and added a direct dependency on swift-http-transport 1.1.2. api-client 3.0.3 stopped
re-exportingHTTPTransport, and this package namesHTTPTransport,HTTPStreamingTransport,
URLSessionTransportandSSEEventinternally, so it now depends on and imports that module
itself. None of those types appear in this package's public API, so nothing is asked of
consumers beyond resolving the new floors.