@squidcloud/backend 1.0.364 → 1.0.366

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.
@@ -1,5 +1,5 @@
1
- import { AiFunctionId, ApiEndpointId, CollectionName, IntegrationId, IntegrationType, TopicName } from '@squidcloud/client';
2
- import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, ExecutableAction, LimiterConfig, LimitsAction, SchedulerAction, SecureAiAgentAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
1
+ import { AiFunctionId, ApiEndpointId, CollectionName, IntegrationId, IntegrationType, LlmModelMetadata, LlmModelName, TopicName } from '@squidcloud/client';
2
+ import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, ExecutableAction, LimiterConfig, LimitsAction, LlmAskAction, SchedulerAction, SecureAiAgentAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
3
3
  import { AiFunctionsConfiguratorRequest, AiFunctionsConfiguratorResponse, CronExpression, CronExpressionString, MutationType, SchedulerId, TriggerId, WebhookId } from './public-types';
4
4
  import { AiFunctionAttributes, AiFunctionParam, DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from '../../internal-common/src/public-types-backend/bundle-data.public-types';
5
5
  /**
@@ -120,7 +120,7 @@ export declare function secureGraphQL(integrationId: IntegrationId): ActionMetho
120
120
  * Once exposed, the decorated function can be executed using Squid's `executeFunction` method.
121
121
  *
122
122
  * For detailed guidance on executable functions, see:
123
- * {@link https://docs.getsquid.ai/docs/backend/executables/ documentation}
123
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/executables documentation}
124
124
  * @category Decorator
125
125
  */
126
126
  export declare function executable(): ActionMethodDecorator<ExecutableAction>;
@@ -146,7 +146,7 @@ export interface AiFunctionMetadataOptions {
146
146
  * The function accepts a JSON object as described in the description of the function in the annotation.
147
147
  *
148
148
  * To read more about exposing an executable, see the
149
- * {@link https://docs.getsquid.ai/docs/ai/ai-functions/ documentation}.
149
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/ai/ai-functions documentation}.
150
150
  * @category AI
151
151
  * @category Decorator
152
152
  */
@@ -156,7 +156,7 @@ export declare function aiFunction<ParamType extends Record<string, any> = any>(
156
156
  * The function accepts a JSON object as described in the description of the function in the annotation.
157
157
  *
158
158
  * To read more about exposing an executable, see the
159
- * {@link https://docs.getsquid.ai/docs/ai/ai-functions/ documentation}.
159
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/ai/ai-functions documentation}.
160
160
  * @category AI
161
161
  * @category Decorator
162
162
  */
@@ -216,7 +216,7 @@ export interface TriggerOptions {
216
216
  * The function accepts a context object as a parameter. The context object contains information about the change.
217
217
  *
218
218
  * To read more about triggers, see the
219
- * {@link https://docs.getsquid.ai/docs/backend/triggers/ documentation}.
219
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/triggers documentation}.
220
220
  *
221
221
  * @param id The ID of the trigger. Should be unique.
222
222
  * @param collectionName The name of the collection to trigger on.
@@ -231,7 +231,7 @@ export declare function trigger(id: TriggerId, collectionName: CollectionName, i
231
231
  * The function accepts a context object as a parameter. The context object contains information about the change.
232
232
  *
233
233
  * To read more about triggers, see the
234
- * {@link https://docs.getsquid.ai/docs/backend/triggers/ documentation}.
234
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/triggers documentation}.
235
235
  * @category Decorator
236
236
  */
237
237
  export declare function trigger(options: TriggerOptions): ActionMethodDecorator<TriggerAction>;
@@ -259,7 +259,7 @@ export interface SchedulerOptions {
259
259
  * expression.
260
260
  *
261
261
  * To read more about schedulers, see the
262
- * {@link https://docs.getsquid.ai/docs/backend/schedulers/ documentation}.
262
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/schedulers documentation}.
263
263
  *
264
264
  * @param id The ID of the scheduler. Should be unique.
265
265
  * @param cronExpression The cron expression (in UTC) to schedule the function on.
@@ -273,7 +273,7 @@ export declare function scheduler(id: SchedulerId, cronExpression: CronExpressio
273
273
  * The function will be called according to the provided cron expression.
274
274
  *
275
275
  * To read more about schedulers, see the
276
- * {@link https://docs.getsquid.ai/docs/backend/schedulers/ documentation}.
276
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/schedulers documentation}.
277
277
  * @category Decorator
278
278
  */
279
279
  export declare function scheduler(options: SchedulerOptions): ActionMethodDecorator<SchedulerAction>;
@@ -288,7 +288,7 @@ export declare function scheduler(options: SchedulerOptions): ActionMethodDecora
288
288
  * `this.createWebhookResponse(<params>)`.
289
289
  *
290
290
  * To read more about webhooks, see the
291
- * {@link https://docs.getsquid.ai/docs/backend/webhooks/ documentation}.
291
+ * {@link https://docs.getsquid.ai/docs/sdk/backend-sdk/webhooks documentation}.
292
292
  * @param id The ID of the webhook. Should be unique.
293
293
  * @category Decorator
294
294
  */
@@ -405,6 +405,25 @@ export declare function secureAiAgent(agentId?: string): ActionMethodDecorator<S
405
405
  * @category Decorator
406
406
  */
407
407
  export declare function limits(options: LimiterConfig): ActionMethodDecorator<LimitsAction>;
408
+ /**
409
+ * Options for the `@llmService` decorator.
410
+ */
411
+ export interface LlmServiceOptions {
412
+ /**
413
+ * Map of model names to their metadata.
414
+ */
415
+ models: Record<LlmModelName, LlmModelMetadata>;
416
+ }
417
+ /**
418
+ * Decorator‐factory that takes service options and returns a ClassDecorator.
419
+ * @category Decorator
420
+ */
421
+ export declare function llmService(opts: LlmServiceOptions): ClassDecorator;
422
+ /**
423
+ * A decorator to mark a function to call to ask an LLM for a response.
424
+ * @category Decorator
425
+ */
426
+ export declare function llmAsk(): ActionMethodDecorator<LlmAskAction>;
408
427
  /**
409
428
  * Decorator that marks a function for handling a client connection state change.
410
429
  * @category Platform
@@ -3,4 +3,5 @@ export * from './metadata';
3
3
  export * from './project';
4
4
  export * from './public-types';
5
5
  export * from './service';
6
+ export * from './llm-service';
6
7
  export * from './utils';
@@ -0,0 +1,12 @@
1
+ import { SquidService } from './service';
2
+ /**
3
+ * Abstract class representing a service for interacting with LLMs (Large Language Models).
4
+ */
5
+ export declare abstract class SquidLlmService extends SquidService {
6
+ /**
7
+ * Asks a question to the LLM and returns the response.
8
+ * @param prompt The prompt to send to the LLM.
9
+ * @param model The name of the model to use for the request.
10
+ */
11
+ abstract ask(prompt: string, model: string): Promise<string>;
12
+ }
@@ -8,4 +8,5 @@ export * from '../../internal-common/src/public-types-backend/metric.public-cont
8
8
  export * from '../../internal-common/src/public-types-backend/mutation.public-context';
9
9
  export * from '../../internal-common/src/public-types-backend/native-query.public-context';
10
10
  export * from '../../internal-common/src/public-types-backend/query.public-context';
11
+ export * from '../../internal-common/src/public-types-backend/storage.public-types';
11
12
  export * from '../../internal-common/src/public-types-backend/topic.public-context';