@aigne/core 1.0.4 → 1.0.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/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/constants.js +1 -1
- package/lib/cjs/definitions/open-api.d.ts +1 -1
- package/lib/cjs/function-agent.d.ts +29 -14
- package/lib/cjs/function-agent.js +8 -23
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/runtime.d.ts +2 -2
- package/lib/cjs/runtime.js +8 -6
- package/lib/cjs/sandbox-function-agent.d.ts +49 -0
- package/lib/cjs/{local-function-agent.js → sandbox-function-agent.js} +30 -15
- package/lib/cjs/{function-runner.d.ts → sandbox-function-runner.d.ts} +4 -4
- package/lib/cjs/{function-runner.js → sandbox-function-runner.js} +6 -6
- package/lib/cjs/utils/open-api-parameter.js +1 -1
- package/lib/dts/constants.d.ts +1 -1
- package/lib/dts/definitions/open-api.d.ts +1 -1
- package/lib/dts/function-agent.d.ts +29 -14
- package/lib/dts/index.d.ts +2 -2
- package/lib/dts/runtime.d.ts +2 -2
- package/lib/dts/sandbox-function-agent.d.ts +49 -0
- package/lib/dts/{function-runner.d.ts → sandbox-function-runner.d.ts} +4 -4
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +1 -1
- package/lib/esm/definitions/open-api.d.ts +1 -1
- package/lib/esm/function-agent.d.ts +29 -14
- package/lib/esm/function-agent.js +9 -23
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/runtime.d.ts +2 -2
- package/lib/esm/runtime.js +8 -6
- package/lib/esm/sandbox-function-agent.d.ts +49 -0
- package/lib/esm/{local-function-agent.js → sandbox-function-agent.js} +29 -15
- package/lib/esm/{function-runner.d.ts → sandbox-function-runner.d.ts} +4 -4
- package/lib/esm/{function-runner.js → sandbox-function-runner.js} +4 -4
- package/lib/esm/utils/open-api-parameter.js +1 -1
- package/package.json +1 -1
- package/lib/cjs/local-function-agent.d.ts +0 -64
- package/lib/dts/local-function-agent.d.ts +0 -64
- package/lib/esm/local-function-agent.d.ts +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Agent, type AgentProcessOptions } from "./agent";
|
|
2
|
-
import type { Context, ContextState } from "./context";
|
|
3
|
-
import { type DataTypeSchema, type SchemaMapType } from "./definitions/data-type-schema";
|
|
4
|
-
import { type CreateRunnableMemory } from "./definitions/memory";
|
|
5
|
-
import type { MemorableSearchOutput, MemoryItemWithScore } from "./memorable";
|
|
6
|
-
import type { RunnableDefinition, RunnableResponse, RunnableResponseChunk } from "./runnable";
|
|
7
|
-
export declare class LocalFunctionAgent<I extends {
|
|
8
|
-
[name: string]: any;
|
|
9
|
-
} = {}, O extends {
|
|
10
|
-
[name: string]: any;
|
|
11
|
-
} = {}, Memories extends {
|
|
12
|
-
[name: string]: MemoryItemWithScore[];
|
|
13
|
-
} = {}, State extends ContextState = ContextState> extends Agent<I, O, Memories, State> {
|
|
14
|
-
definition: LocalFunctionAgentDefinition<I, O, Memories, State>;
|
|
15
|
-
static create: typeof create;
|
|
16
|
-
constructor(definition: LocalFunctionAgentDefinition<I, O, Memories, State>, context?: Context<State>);
|
|
17
|
-
process(input: I, options: AgentProcessOptions<Memories>): Promise<AsyncGenerator<RunnableResponseChunk<O>, void, any> | RunnableResponse<O>>;
|
|
18
|
-
}
|
|
19
|
-
export interface LocalFunctionAgentDefinition<I extends {
|
|
20
|
-
[name: string]: any;
|
|
21
|
-
}, O extends {
|
|
22
|
-
[name: string]: any;
|
|
23
|
-
}, Memories extends {
|
|
24
|
-
[name: string]: MemoryItemWithScore[];
|
|
25
|
-
}, State extends ContextState> extends RunnableDefinition {
|
|
26
|
-
type: "local_function_agent";
|
|
27
|
-
function?: LocalFunctionFuncType<I, O, Memories, State>;
|
|
28
|
-
}
|
|
29
|
-
export type LocalFunctionFuncType<I extends {
|
|
30
|
-
[name: string]: any;
|
|
31
|
-
}, O extends {
|
|
32
|
-
[name: string]: any;
|
|
33
|
-
}, Memories extends {
|
|
34
|
-
[name: string]: MemoryItemWithScore[];
|
|
35
|
-
}, State extends ContextState> = (input: I, options: {
|
|
36
|
-
memories: Memories;
|
|
37
|
-
context: Context<State>;
|
|
38
|
-
}) => Promise<RunnableResponse<O> | AsyncGenerator<RunnableResponseChunk<O>, void>> | AsyncGenerator<RunnableResponseChunk<O>, void>;
|
|
39
|
-
export interface CreateLocalFunctionAgentOptions<I extends {
|
|
40
|
-
[name: string]: DataTypeSchema;
|
|
41
|
-
}, O extends {
|
|
42
|
-
[name: string]: DataTypeSchema;
|
|
43
|
-
}, Memories extends {
|
|
44
|
-
[name: string]: CreateRunnableMemory<I>;
|
|
45
|
-
}, State extends ContextState> {
|
|
46
|
-
context?: Context<State>;
|
|
47
|
-
name?: string;
|
|
48
|
-
inputs: I;
|
|
49
|
-
outputs: O;
|
|
50
|
-
memories?: Memories;
|
|
51
|
-
function?: LocalFunctionFuncType<SchemaMapType<I>, SchemaMapType<O>, {
|
|
52
|
-
[key in keyof Memories]: MemorableSearchOutput<Memories[key]["memory"]>;
|
|
53
|
-
}, State>;
|
|
54
|
-
}
|
|
55
|
-
declare function create<I extends {
|
|
56
|
-
[name: string]: DataTypeSchema;
|
|
57
|
-
}, O extends {
|
|
58
|
-
[name: string]: DataTypeSchema;
|
|
59
|
-
}, Memories extends {
|
|
60
|
-
[name: string]: CreateRunnableMemory<I>;
|
|
61
|
-
}, State extends ContextState>({ context, ...options }: CreateLocalFunctionAgentOptions<I, O, Memories, State>): LocalFunctionAgent<SchemaMapType<I>, SchemaMapType<O>, {
|
|
62
|
-
[name in keyof Memories]: MemorableSearchOutput<Memories[name]["memory"]>;
|
|
63
|
-
}, State>;
|
|
64
|
-
export {};
|