@xsai/generate-text 0.0.28 → 0.0.29
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/dist/index.d.ts +12 -12
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22,18 +22,6 @@ interface GenerateTextResponse {
|
|
|
22
22
|
system_fingerprint: string;
|
|
23
23
|
usage: Usage;
|
|
24
24
|
}
|
|
25
|
-
interface ToolCall {
|
|
26
|
-
args: string;
|
|
27
|
-
toolCallId: string;
|
|
28
|
-
toolCallType: 'function';
|
|
29
|
-
toolName: string;
|
|
30
|
-
}
|
|
31
|
-
interface ToolResult {
|
|
32
|
-
args: Record<string, unknown>;
|
|
33
|
-
result: string;
|
|
34
|
-
toolCallId: string;
|
|
35
|
-
toolName: string;
|
|
36
|
-
}
|
|
37
25
|
interface GenerateTextResult {
|
|
38
26
|
finishReason: FinishReason;
|
|
39
27
|
steps: StepResult[];
|
|
@@ -48,6 +36,18 @@ interface StepResult {
|
|
|
48
36
|
toolResults: ToolResult[];
|
|
49
37
|
usage: Usage;
|
|
50
38
|
}
|
|
39
|
+
interface ToolCall {
|
|
40
|
+
args: string;
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
toolCallType: 'function';
|
|
43
|
+
toolName: string;
|
|
44
|
+
}
|
|
45
|
+
interface ToolResult {
|
|
46
|
+
args: Record<string, unknown>;
|
|
47
|
+
result: string;
|
|
48
|
+
toolCallId: string;
|
|
49
|
+
toolName: string;
|
|
50
|
+
}
|
|
51
51
|
declare const generateText: (options: GenerateTextOptions) => Promise<GenerateTextResult>;
|
|
52
52
|
|
|
53
53
|
export { type GenerateTextOptions, type GenerateTextResponse, type GenerateTextResult, type StepResult, type ToolCall, type ToolResult, generateText as default, generateText };
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { chat } from '@xsai/shared-chat';
|
|
|
2
2
|
|
|
3
3
|
const rawGenerateText = async (options) => await chat({
|
|
4
4
|
...options,
|
|
5
|
-
maxSteps:
|
|
5
|
+
maxSteps: undefined,
|
|
6
6
|
messages: options.messages,
|
|
7
|
-
steps:
|
|
7
|
+
steps: undefined,
|
|
8
8
|
stream: false
|
|
9
9
|
}).then((res) => res.json()).then(async ({ choices, usage }) => {
|
|
10
10
|
const messages = options.messages;
|