1 from dataclasses import dataclass

2 from enum import Enum

3 class MessageRole(Enum): SYSTEM='system'; USER='user'; ASSISTANT='assistant'

4@dataclass

5 class Message: role:MessageRole=MessageRole.USER; content:str=''

6@dataclass

7 class ToolParameter: name:str=''

8@dataclass

9 class ToolFunction: name:str=''

10@dataclass

11 class Tool: type:str='function'

12@dataclass

13 class ToolCall: id:str=''

14@dataclass

15 class CompletionChoice: text:str=''

16@dataclass

17 class TokenUsage: prompt:int=0; completion:int=0

18@dataclass

19 class CompletionUsage: pass

20@dataclass

21 class CompletionResult: choices:list=None

22@dataclass

23 class StreamChunk: content:str=''

24 class LLMProvider: pass

25 class OpenAIProvider(LLMProvider): pass

26 class DeepSeekProvider(LLMProvider): pass

27 class AnthropicProvider(LLMProvider): pass

28 def create_provider(name:str) -> LLMProvider: return OpenAIProvider()