@aigne/core 0.4.201-5 → 0.4.201-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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,19 +1,16 @@
1
1
  import type { Context } from './context';
2
- import { DataTypeSchema, SchemaMapType } from './data-type-schema';
3
2
  import { LLMModel, LLMModelInputMessage, LLMModelInputs, LLMModelOptions } from './llm-model';
4
3
  import { RunOptions, Runnable, RunnableDefinition, RunnableResponseStream } from './runnable';
5
4
  import { OrderedRecord } from './utils';
5
+ import { ExtractRunnableInputType, ExtractRunnableOutputType } from './utils/runnable-type';
6
+ import { ObjectUnionToIntersection } from './utils/union';
6
7
  export declare class LLMDecisionAgent<I extends {
7
8
  [key: string]: any;
8
9
  } = {}, O extends {} = {}> extends Runnable<I, O> {
9
10
  definition: LLMDecisionAgentDefinition;
10
11
  model?: LLMModel | undefined;
11
12
  context?: Context | undefined;
12
- static create<I extends {
13
- [name: string]: DataTypeSchema;
14
- }, O extends {
15
- [name: string]: DataTypeSchema;
16
- }>(options: Parameters<typeof createLLMDecisionAgentDefinition<I>>[0]): LLMDecisionAgent<SchemaMapType<I>, SchemaMapType<O>>;
13
+ static create<Case extends DecisionAgentCaseParameter>(options: Parameters<typeof createLLMDecisionAgentDefinition<Case>>[0]): LLMDecisionAgent<ObjectUnionToIntersection<ExtractRunnableInputType<Case['runnable']>>, ExtractRunnableOutputType<Case['runnable']>>;
17
14
  constructor(definition: LLMDecisionAgentDefinition, model?: LLMModel | undefined, context?: Context | undefined);
18
15
  run(input: I, options: RunOptions & {
19
16
  stream: true;
@@ -22,7 +19,7 @@ export declare class LLMDecisionAgent<I extends {
22
19
  stream?: false;
23
20
  }): Promise<O>;
24
21
  }
25
- export interface DecisionAgentCaseParameter<I extends {} = {}, O extends {} = {}, R = Runnable<I, O>> {
22
+ export interface DecisionAgentCaseParameter<R extends Runnable = Runnable> {
26
23
  name?: string;
27
24
  description?: string;
28
25
  runnable: R;
@@ -33,15 +30,12 @@ export interface DecisionAgentCaseParameter<I extends {} = {}, O extends {} = {}
33
30
  } | undefined;
34
31
  };
35
32
  }
36
- export declare function createLLMDecisionAgentDefinition<I extends {
37
- [name: string]: DataTypeSchema;
38
- }>(options: {
33
+ export declare function createLLMDecisionAgentDefinition<Case extends DecisionAgentCaseParameter>(options: {
39
34
  id?: string;
40
35
  name?: string;
41
- inputs: I;
42
36
  messages: string;
43
37
  modelOptions?: LLMModelOptions;
44
- cases: DecisionAgentCaseParameter[];
38
+ cases: Case[];
45
39
  }): LLMDecisionAgentDefinition;
46
40
  export interface LLMDecisionAgentDefinition extends RunnableDefinition {
47
41
  type: 'llm_decision_agent';