@discomedia/utils 1.0.76 → 1.0.77

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.
@@ -346,7 +346,7 @@ const safeJSON = (text) => {
346
346
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
347
347
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
348
348
 
349
- const VERSION = '6.41.0'; // x-release-please-version
349
+ const VERSION = '6.44.0'; // x-release-please-version
350
350
 
351
351
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
352
352
  const isRunningInBrowser = () => {
@@ -2732,7 +2732,12 @@ _AbstractChatCompletionRunner_instances = new WeakSet(), _AbstractChatCompletion
2732
2732
  for (let i = this.messages.length - 1; i >= 0; i--) {
2733
2733
  const message = this.messages[i];
2734
2734
  if (isAssistantMessage(message) && message?.tool_calls?.length) {
2735
- return message.tool_calls.filter((x) => x.type === 'function').at(-1)?.function;
2735
+ for (let j = message.tool_calls.length - 1; j >= 0; j--) {
2736
+ const toolCall = message.tool_calls[j];
2737
+ if (toolCall?.type === 'function') {
2738
+ return toolCall.function;
2739
+ }
2740
+ }
2736
2741
  }
2737
2742
  }
2738
2743
  return;
@@ -4110,6 +4115,23 @@ let SpendAlerts$1 = class SpendAlerts extends APIResource {
4110
4115
  __security: { adminAPIKeyAuth: true },
4111
4116
  });
4112
4117
  }
4118
+ /**
4119
+ * Retrieves an organization spend alert.
4120
+ *
4121
+ * @example
4122
+ * ```ts
4123
+ * const organizationSpendAlert =
4124
+ * await client.admin.organization.spendAlerts.retrieve(
4125
+ * 'alert_id',
4126
+ * );
4127
+ * ```
4128
+ */
4129
+ retrieve(alertID, options) {
4130
+ return this._client.get(path `/organization/spend_alerts/${alertID}`, {
4131
+ ...options,
4132
+ __security: { adminAPIKeyAuth: true },
4133
+ });
4134
+ }
4113
4135
  /**
4114
4136
  * Updates an organization spend alert.
4115
4137
  *
@@ -5141,6 +5163,25 @@ class SpendAlerts extends APIResource {
5141
5163
  __security: { adminAPIKeyAuth: true },
5142
5164
  });
5143
5165
  }
5166
+ /**
5167
+ * Retrieves a project spend alert.
5168
+ *
5169
+ * @example
5170
+ * ```ts
5171
+ * const projectSpendAlert =
5172
+ * await client.admin.organization.projects.spendAlerts.retrieve(
5173
+ * 'alert_id',
5174
+ * { project_id: 'project_id' },
5175
+ * );
5176
+ * ```
5177
+ */
5178
+ retrieve(alertID, params, options) {
5179
+ const { project_id } = params;
5180
+ return this._client.get(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
5181
+ ...options,
5182
+ __security: { adminAPIKeyAuth: true },
5183
+ });
5184
+ }
5144
5185
  /**
5145
5186
  * Updates a project spend alert.
5146
5187
  *