botinabox 2.9.5 → 2.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,89 +0,0 @@
1
- /** LLM provider types — Story 1.5 / 2.1 */
2
- interface ToolDefinition {
3
- name: string;
4
- description: string;
5
- parameters: Record<string, unknown>;
6
- }
7
- interface ChatMessage {
8
- role: "user" | "assistant" | "system";
9
- content: string | ContentBlock[];
10
- }
11
- type ContentBlock = {
12
- type: "text";
13
- text: string;
14
- } | {
15
- type: "tool_use";
16
- id: string;
17
- name: string;
18
- input: unknown;
19
- } | {
20
- type: "tool_result";
21
- tool_use_id: string;
22
- content: string;
23
- } | {
24
- type: "image";
25
- source: {
26
- type: "base64";
27
- media_type: string;
28
- data: string;
29
- };
30
- } | {
31
- type: "document";
32
- source: {
33
- type: "base64";
34
- media_type: "application/pdf";
35
- data: string;
36
- };
37
- };
38
- interface ChatParams {
39
- messages: ChatMessage[];
40
- system?: string;
41
- tools?: ToolDefinition[];
42
- maxTokens?: number;
43
- temperature?: number;
44
- model: string;
45
- abortSignal?: AbortSignal;
46
- }
47
- interface TokenUsage {
48
- inputTokens: number;
49
- outputTokens: number;
50
- cacheReadTokens?: number;
51
- cacheWriteTokens?: number;
52
- }
53
- interface ChatResult {
54
- content: string;
55
- toolUses?: ToolUse[];
56
- usage: TokenUsage;
57
- model: string;
58
- stopReason: "end_turn" | "tool_use" | "max_tokens" | "stop_sequence";
59
- }
60
- interface ToolUse {
61
- id: string;
62
- name: string;
63
- input: unknown;
64
- }
65
- interface ModelInfo {
66
- id: string;
67
- displayName: string;
68
- contextWindow: number;
69
- maxOutputTokens: number;
70
- capabilities: Array<"chat" | "tools" | "vision" | "streaming">;
71
- /** Cost in micro-cents per 1M tokens */
72
- inputCostPerMToken?: number;
73
- outputCostPerMToken?: number;
74
- }
75
- interface ResolvedModel {
76
- provider: string;
77
- model: string;
78
- }
79
- interface LLMProvider {
80
- id: string;
81
- displayName: string;
82
- models: ModelInfo[];
83
- chat(params: ChatParams): Promise<ChatResult>;
84
- chatStream(params: ChatParams): AsyncGenerator<string, ChatResult, unknown>;
85
- /** Convert ToolDefinition[] to provider-native format */
86
- serializeTools(tools: ToolDefinition[]): unknown;
87
- }
88
-
89
- export type { ChatMessage as C, LLMProvider as L, ModelInfo as M, ResolvedModel as R, TokenUsage as T, ChatParams as a, ChatResult as b, ContentBlock as c, ToolUse as d, ToolDefinition as e };