Revision control
Copy as Markdown
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
import Foundation
/// Interface for a litellm client for both streamed and non-streamed responses.
/// This used because we want to be able to replace the real `LiteLLMClient` with a mock during testing.
protocol LiteLLMClientProtocol {
/// Sends a non-streaming chat completion request.
func requestChatCompletion(
messages: [LiteLLMMessage],
config: SummarizerConfig
) async throws -> String
/// Sends a streaming chat completion request.
func requestChatCompletionStreamed(
messages: [LiteLLMMessage],
config: SummarizerConfig
) -> AsyncThrowingStream<String, Error>
}