@keo-ai/axiom 0.1.4 → 0.1.6
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.
- package/README.md +29 -28
- package/dist/function_call_loop/index.d.ts +3 -3
- package/dist/function_call_loop/index.js +3 -3
- package/dist/function_call_loop/loop.d.ts +0 -21
- package/dist/function_call_loop/loop.js +33 -57
- package/dist/function_call_loop/provider.d.ts +2 -2
- package/dist/function_call_loop/provider.js +38 -53
- package/dist/function_call_loop/types.d.ts +9 -6
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/llm_provider/bailian.d.ts +28 -0
- package/dist/llm_provider/bailian.js +175 -0
- package/dist/llm_provider/index.d.ts +73 -0
- package/dist/llm_provider/index.js +62 -0
- package/dist/llm_provider/llm.d.ts +32 -0
- package/dist/llm_provider/llm.js +2 -0
- package/dist/llm_provider/models.d.ts +14 -0
- package/dist/llm_provider/models.js +18 -0
- package/dist/llm_provider/types.d.ts +51 -0
- package/dist/llm_provider/types.js +2 -0
- package/dist/predict/config.d.ts +2 -2
- package/dist/predict/index.d.ts +6 -5
- package/dist/predict/index.js +2 -2
- package/dist/predict/llm.d.ts +3 -33
- package/dist/predict/llm.js +1 -1
- package/dist/predict/models.d.ts +2 -14
- package/dist/predict/models.js +2 -14
- package/dist/predict/predict.d.ts +1 -1
- package/dist/predict/predict.js +1 -1
- package/dist/predict/types.d.ts +1 -51
- package/package.json +1 -1
package/dist/predict/types.d.ts
CHANGED
|
@@ -1,51 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* LLM 对话消息。支持 system、user、assistant 三种角色。
|
|
3
|
-
*/
|
|
4
|
-
export interface Message {
|
|
5
|
-
readonly role: 'system' | 'user' | 'assistant';
|
|
6
|
-
readonly content: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* 标准化 LLM 请求参数。各 Provider 据此构建自身的协议请求。
|
|
10
|
-
*/
|
|
11
|
-
export interface LLMRequest {
|
|
12
|
-
readonly messages: ReadonlyArray<Message>;
|
|
13
|
-
readonly temperature?: number;
|
|
14
|
-
readonly maxTokens?: number;
|
|
15
|
-
readonly topP?: number;
|
|
16
|
-
readonly stream?: boolean;
|
|
17
|
-
readonly model?: string;
|
|
18
|
-
readonly responseFormat?: 'text' | 'json';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 标准化 LLM 响应。各 Provider 将原始响应解析为此格式后返回。
|
|
22
|
-
*/
|
|
23
|
-
export interface LLMResponse {
|
|
24
|
-
readonly content: string | null;
|
|
25
|
-
readonly usage?: {
|
|
26
|
-
readonly promptTokens: number;
|
|
27
|
-
readonly completionTokens: number;
|
|
28
|
-
readonly totalTokens: number;
|
|
29
|
-
};
|
|
30
|
-
readonly model: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* 流式输出片段。迭代器每次 yield 一个 chunk。
|
|
34
|
-
*/
|
|
35
|
-
export type StreamChunk = {
|
|
36
|
-
readonly type: 'content';
|
|
37
|
-
readonly delta: string;
|
|
38
|
-
} | {
|
|
39
|
-
readonly type: 'finish';
|
|
40
|
-
readonly usage?: LLMResponse['usage'];
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Provider 配置。每个 Provider 实例需要一组连接参数。
|
|
44
|
-
*/
|
|
45
|
-
export interface ProviderConfig {
|
|
46
|
-
readonly name: string;
|
|
47
|
-
readonly apiKey: string;
|
|
48
|
-
readonly baseUrl: string;
|
|
49
|
-
readonly defaultModel: string;
|
|
50
|
-
readonly timeoutMs?: number;
|
|
51
|
-
}
|
|
1
|
+
export type { Message, LLMRequest, LLMResponse, ProviderConfig, StreamChunk, } from '../llm_provider/types';
|