@tangle-network/agent-app 3.0.26 → 3.0.27

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.
@@ -63,9 +63,9 @@ export declare function createDefaultChatBackend<TContext, TResource>(projectId:
63
63
  modelPolicy: ModelPolicy<import("../policy-filters/index.js").PolicyFilterContext> | undefined;
64
64
  modelFailover: false;
65
65
  errorNotice: boolean;
66
- openEvents: ({ model, signal }: {
66
+ openEvents: ({ signal }: {
67
67
  model: string;
68
68
  signal: AbortSignal;
69
- }) => AsyncGenerator<unknown, void, any>;
69
+ }) => AsyncGenerator<unknown, any, any>;
70
70
  }>;
71
71
  };
@@ -84,7 +84,7 @@ import {
84
84
  turnCarriesFiles,
85
85
  turnPromptText,
86
86
  withProducerStream
87
- } from "../chunk-IV2QLOA2.js";
87
+ } from "../chunk-5OE6SCHS.js";
88
88
  import "../chunk-SBHFMDR7.js";
89
89
  import "../chunk-H6BRJU5M.js";
90
90
  import "../chunk-4DBHC63F.js";
@@ -3649,22 +3649,20 @@ function createDefaultChatBackend(projectId, env, config, bindings, modelPolicy)
3649
3649
  sandbox: async (args) => {
3650
3650
  const model = modelFor(args);
3651
3651
  if (modelPolicy) await assertPolicy({ kind: "model", id: model, ...modelPolicy });
3652
+ const own = config.providers?.[model];
3653
+ const provider = typeof own === "function" ? await own(args) : own;
3652
3654
  const box = await acquire(args);
3653
3655
  return {
3654
3656
  model,
3655
3657
  modelPolicy,
3656
3658
  modelFailover: false,
3657
3659
  errorNotice: true,
3658
- openEvents: async function* ({ model: model2, signal }) {
3659
- const own = config.providers?.[model2];
3660
- const provider = typeof own === "function" ? await own(args) : own;
3661
- yield* streamSandboxPrompt(
3662
- provider ? { ...shell, provider } : shell,
3663
- box,
3664
- normalizeChatPromptForSandbox(args.prompt),
3665
- { ...promptOptions(args), model: model2, signal }
3666
- );
3667
- }
3660
+ openEvents: ({ signal }) => streamSandboxPrompt(
3661
+ provider ? { ...shell, provider } : shell,
3662
+ box,
3663
+ normalizeChatPromptForSandbox(args.prompt),
3664
+ { ...promptOptions(args), model, signal }
3665
+ )
3668
3666
  };
3669
3667
  }
3670
3668
  };
@@ -4179,4 +4177,4 @@ export {
4179
4177
  createChatTurnRoutes,
4180
4178
  streamChatRouteAsSandboxEvents
4181
4179
  };
4182
- //# sourceMappingURL=chunk-IV2QLOA2.js.map
4180
+ //# sourceMappingURL=chunk-5OE6SCHS.js.map