@triggerlink/sdk 0.4.4 → 0.4.5
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/agent.d.ts +7 -2
- package/dist/serve.d.ts +1 -1
- package/dist/serve.js +1 -1
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { type LanguageModel, type
|
|
1
|
+
import { type AssistantModelMessage, type LanguageModel, type ToolModelMessage, type UserModelMessage } from "ai";
|
|
2
2
|
import type { ZodType } from "zod";
|
|
3
3
|
import type { StepTool } from "./step.js";
|
|
4
|
+
/**
|
|
5
|
+
* 对话消息:user / assistant / tool 三种(不含 system——system prompt 走
|
|
6
|
+
* AgentOpts.system 参数,不进消息列表)。AgentResult.output 的元素类型。
|
|
7
|
+
*/
|
|
8
|
+
export type TextMessage = UserModelMessage | AssistantModelMessage | ToolModelMessage;
|
|
4
9
|
export { anthropic, createAnthropic } from "@ai-sdk/anthropic";
|
|
5
10
|
export { openai, createOpenAI } from "@ai-sdk/openai";
|
|
6
11
|
export { deepseek, createDeepSeek } from "@ai-sdk/deepseek";
|
|
@@ -63,7 +68,7 @@ export interface AgentResult {
|
|
|
63
68
|
* 的 result.output 对齐——可自行 findLastIndex 等遍历(元素含 role/content)。
|
|
64
69
|
* 恢复重放时由 memo 原样重建;启用 redact 时历史内容即脱敏后内容。
|
|
65
70
|
*/
|
|
66
|
-
output:
|
|
71
|
+
output: TextMessage[];
|
|
67
72
|
}
|
|
68
73
|
/** 取最后一条 assistant 消息的文本内容(拼接所有 text part);没有则返回 undefined。 */
|
|
69
74
|
export declare function lastAssistantTextMessageContent(result: AgentResult): string | undefined;
|
package/dist/serve.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Client } from "./client.js";
|
|
2
2
|
import type { TriggerFunction } from "./function.js";
|
|
3
|
-
export declare const sdkVersion = "triggerlink-ts/0.4.
|
|
3
|
+
export declare const sdkVersion = "triggerlink-ts/0.4.5";
|
|
4
4
|
export declare const SIGNATURE_HEADER = "x-triggerlink-signature";
|
|
5
5
|
export interface ServeOptions {
|
|
6
6
|
client: Client;
|
package/dist/serve.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExecCtx, StepInterrupt } from "./execx.js";
|
|
2
2
|
import { createStepTool, errMessage } from "./step.js";
|
|
3
3
|
import { verifySignature } from "./sign.js";
|
|
4
|
-
export const sdkVersion = "triggerlink-ts/0.4.
|
|
4
|
+
export const sdkVersion = "triggerlink-ts/0.4.5";
|
|
5
5
|
export const SIGNATURE_HEADER = "x-triggerlink-signature";
|
|
6
6
|
const MAX_BODY = 10 << 20; // 10 MB,与平台一致
|
|
7
7
|
function json(data, status = 200) {
|