zeitlich 0.2.5 → 0.2.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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineQuery, proxyActivities, setHandler, uuid4, workflowInfo, executeChild } from '@temporalio/workflow';
2
2
  import z3, { z } from 'zod';
3
3
  import { SimplePlugin } from '@temporalio/plugin';
4
- import { mapStoredMessagesToChatMessages, AIMessage, ToolMessage, HumanMessage } from '@langchain/core/messages';
4
+ import { mapStoredMessagesToChatMessages, AIMessage, ToolMessage, SystemMessage, HumanMessage } from '@langchain/core/messages';
5
5
  import crypto from 'crypto';
6
6
  import { Context } from '@temporalio/activity';
7
7
  import { Bash } from 'just-bash';
@@ -1071,6 +1071,12 @@ function createThreadManager(config) {
1071
1071
  content
1072
1072
  }).toDict();
1073
1073
  },
1074
+ createSystemMessage(content) {
1075
+ return new SystemMessage({
1076
+ id: v4_default(),
1077
+ content
1078
+ }).toDict();
1079
+ },
1074
1080
  createAIMessage(content, kwargs) {
1075
1081
  return new AIMessage({
1076
1082
  id: v4_default(),
@@ -1099,6 +1105,10 @@ function createThreadManager(config) {
1099
1105
  async appendAIMessage(content) {
1100
1106
  const message = helpers.createAIMessage(content);
1101
1107
  await base.append([message]);
1108
+ },
1109
+ async appendSystemMessage(content) {
1110
+ const message = helpers.createSystemMessage(content);
1111
+ await base.append([message]);
1102
1112
  }
1103
1113
  };
1104
1114
  return Object.assign(base, helpers);