@aigne/core 0.4.207-4 → 0.4.208-beta.1

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/agent.js CHANGED
@@ -58,6 +58,7 @@ class Agent extends runnable_1.Runnable {
58
58
  }));
59
59
  }
60
60
  async run(input, options) {
61
+ logger_1.default.debug(`AIGNE core: run agent ${this.name || this.id} with`, { input });
61
62
  const memories = await this.loadMemories(input, this.context);
62
63
  const processResult = await this.process(input, { ...options, memories });
63
64
  if (options?.stream) {
@@ -67,6 +68,7 @@ class Agent extends runnable_1.Runnable {
67
68
  : (0, utils_1.objectToRunnableResponseStream)(processResult);
68
69
  return (0, utils_1.extractOutputsFromRunnableOutput)(stream, async (result) => {
69
70
  // TODO: validate result against outputs schema
71
+ logger_1.default.debug(`AIGNE core: run agent ${this.name || this.id} success`, { result });
70
72
  await this.onResult(result);
71
73
  });
72
74
  }
@@ -75,6 +77,7 @@ class Agent extends runnable_1.Runnable {
75
77
  : Symbol.asyncIterator in processResult
76
78
  ? await (0, utils_1.runnableResponseStreamToObject)(processResult)
77
79
  : processResult;
80
+ logger_1.default.debug(`AIGNE core: run agent ${this.name || this.id} success`, { result });
78
81
  // TODO: validate result against outputs schema
79
82
  await this.onResult(result);
80
83
  return result;
@@ -5,7 +5,6 @@ exports.TYPES = {
5
5
  context: Symbol.for('AIGNE_CONTEXT'),
6
6
  definition: Symbol.for('AIGNE_DEFINITION'),
7
7
  llmModel: Symbol.for('AIGNE_LLM_MODEL'),
8
- llmModelConfiguration: Symbol.for('AIGNE_LLM_MODEL_CONFIGURATION'),
9
8
  functionRunner: Symbol.for('AIGNE_FUNCTION_RUNNER'),
10
9
  };
11
10
  exports.StreamTextOutputName = '$text';
package/lib/cjs/index.js CHANGED
@@ -20,6 +20,7 @@ __exportStar(require("./definitions/data-type"), exports);
20
20
  __exportStar(require("./definitions/data-type-schema"), exports);
21
21
  __exportStar(require("./context"), exports);
22
22
  __exportStar(require("./runnable"), exports);
23
+ __exportStar(require("./agent"), exports);
23
24
  __exportStar(require("./pipeline-agent"), exports);
24
25
  __exportStar(require("./llm-agent"), exports);
25
26
  __exportStar(require("./llm-model"), exports);
@@ -66,7 +66,7 @@ let LLMDecisionAgent = class LLMDecisionAgent extends agent_1.Agent {
66
66
  };
67
67
  const { toolCalls } = await model.run(llmInputs);
68
68
  // TODO: support run multiple calls
69
- const functionNameToCall = toolCalls?.[0].function?.name;
69
+ const functionNameToCall = toolCalls?.[0]?.function?.name;
70
70
  if (!functionNameToCall)
71
71
  throw new Error('No any runnable called');
72
72
  const caseToCall = cases.find((i) => i.name === functionNameToCall);