providers/deepseek/deepseek library
Modular DeepSeek Provider
This library provides a modular implementation of the DeepSeek provider
Key Benefits:
- Single Responsibility: Each module handles one capability
- Easier Testing: Modules can be tested independently
- Better Maintainability: Changes isolated to specific modules
- Cleaner Code: Smaller, focused classes
- Reusability: Modules can be reused across providers
Usage:
import 'package:llm_dart/providers/deepseek/deepseek.dart';
final provider = DeepSeekProvider(DeepSeekConfig(
apiKey: 'your-api-key',
model: 'deepseek-chat',
));
// Use chat capability
final response = await provider.chat(messages);
Classes
- DeepSeekChat
- DeepSeek Chat capability implementation
- DeepSeekChatResponse
- DeepSeek chat response implementation
- DeepSeekClient
- Core DeepSeek HTTP client shared across all capability modules
- DeepSeekConfig
- DeepSeek provider configuration
- DeepSeekErrorHandler
- DeepSeek-specific error handler
- DeepSeekModels
- DeepSeek Models capability implementation
- DeepSeekProvider
- DeepSeek provider implementation
Functions
-
createDeepSeekChatProvider(
{required String apiKey, String model = 'deepseek-chat', String? systemPrompt, double? temperature, int? maxTokens}) → DeepSeekProvider - Create a DeepSeek provider for chat
-
createDeepSeekProvider(
{required String apiKey, String? model, String? baseUrl, int? maxTokens, double? temperature, String? systemPrompt, Duration? timeout, bool? stream, double? topP, int? topK}) → DeepSeekProvider - Create a DeepSeek provider with default configuration
-
createDeepSeekReasoningProvider(
{required String apiKey, String model = 'deepseek-reasoner', String? systemPrompt, double? temperature, int? maxTokens}) → DeepSeekProvider - Create a DeepSeek provider for reasoning tasks Uses the deepseek-reasoner model which supports reasoning/thinking