@sprucelabs/sprucebot-llm 15.1.12 → 15.2.0

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.
@@ -12,5 +12,6 @@ export default class SprucebotLlmSkillImpl<StateSchema extends Schema = Schema,
12
12
  serialize(): SerializedSkill<StateSchema, State>;
13
13
  silentlySetState(state: Partial<State>): void;
14
14
  getStateSchema(): StateSchema | undefined;
15
+ updateJobDescription(prompt: string): void;
15
16
  unserialize(serialized: SerializedSkill<StateSchema, State>): void;
16
17
  }
@@ -43,6 +43,9 @@ class SprucebotLlmSkillImpl extends mercury_event_emitter_1.AbstractEventEmitter
43
43
  getStateSchema() {
44
44
  return this.stateSchema;
45
45
  }
46
+ updateJobDescription(prompt) {
47
+ this.options.yourJobIfYouChooseToAcceptItIs = prompt;
48
+ }
46
49
  unserialize(serialized) {
47
50
  const { state, ...options } = serialized;
48
51
  this.state = state;
@@ -12,5 +12,6 @@ export default class SprucebotLlmSkillImpl<StateSchema extends Schema = Schema,
12
12
  serialize(): SerializedSkill<StateSchema, State>;
13
13
  silentlySetState(state: Partial<State>): void;
14
14
  getStateSchema(): StateSchema | undefined;
15
+ updateJobDescription(prompt: string): void;
15
16
  unserialize(serialized: SerializedSkill<StateSchema, State>): void;
16
17
  }
@@ -53,6 +53,9 @@ export default class SprucebotLlmSkillImpl extends AbstractEventEmitter {
53
53
  getStateSchema() {
54
54
  return this.stateSchema;
55
55
  }
56
+ updateJobDescription(prompt) {
57
+ this.options.yourJobIfYouChooseToAcceptItIs = prompt;
58
+ }
56
59
  unserialize(serialized) {
57
60
  const { state } = serialized, options = __rest(serialized, ["state"]);
58
61
  this.state = state;
@@ -72,6 +72,7 @@ export interface SkillOptions<StateSchema extends Schema = Schema, State extends
72
72
  model?: string;
73
73
  }
74
74
  export interface SprucebotLLmSkill<StateSchema extends Schema = Schema, State extends SchemaValues<StateSchema> = SchemaValues<StateSchema>> extends MercuryEventEmitter<LlmEventContract> {
75
+ updateJobDescription(prompt: string): void;
75
76
  getState(): Partial<State> | undefined;
76
77
  serialize(): SerializedSkill<StateSchema, State>;
77
78
  unserialize(serialized: SerializedSkill<StateSchema, State>): void;
@@ -56,12 +56,12 @@ export default class ResponseParserV2 {
56
56
  let callbackStrippedMessage = message;
57
57
  let callbackResults = '';
58
58
  const reserved = new Set(['updateState', 'results']);
59
- const matches = [...message.matchAll(/^@(\w+)\(({.*})\)$/gm)];
59
+ const matches = [...message.matchAll(/^@(\w+)\(({.*})?\)$/gm)];
60
60
  for (const match of matches) {
61
61
  if (reserved.has(match[1])) {
62
62
  continue;
63
63
  }
64
- const parsed = JSON.parse(match[2]);
64
+ const parsed = match[2] ? JSON.parse(match[2]) : undefined;
65
65
  const name = match[1];
66
66
  const options = parsed;
67
67
  const callback = callbacks === null || callbacks === void 0 ? void 0 : callbacks[name];
@@ -72,6 +72,7 @@ export interface SkillOptions<StateSchema extends Schema = Schema, State extends
72
72
  model?: string;
73
73
  }
74
74
  export interface SprucebotLLmSkill<StateSchema extends Schema = Schema, State extends SchemaValues<StateSchema> = SchemaValues<StateSchema>> extends MercuryEventEmitter<LlmEventContract> {
75
+ updateJobDescription(prompt: string): void;
75
76
  getState(): Partial<State> | undefined;
76
77
  serialize(): SerializedSkill<StateSchema, State>;
77
78
  unserialize(serialized: SerializedSkill<StateSchema, State>): void;
@@ -49,12 +49,12 @@ class ResponseParserV2 {
49
49
  let callbackStrippedMessage = message;
50
50
  let callbackResults = '';
51
51
  const reserved = new Set(['updateState', 'results']);
52
- const matches = [...message.matchAll(/^@(\w+)\(({.*})\)$/gm)];
52
+ const matches = [...message.matchAll(/^@(\w+)\(({.*})?\)$/gm)];
53
53
  for (const match of matches) {
54
54
  if (reserved.has(match[1])) {
55
55
  continue;
56
56
  }
57
- const parsed = JSON.parse(match[2]);
57
+ const parsed = match[2] ? JSON.parse(match[2]) : undefined;
58
58
  const name = match[1];
59
59
  const options = parsed;
60
60
  const callback = callbacks?.[name];
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "eta"
9
9
  ]
10
10
  },
11
- "version": "15.1.12",
11
+ "version": "15.2.0",
12
12
  "files": [
13
13
  "build"
14
14
  ],