@squidcloud/slack-client 1.0.409
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/connectors/slack/common/src/slack-types.d.ts +98 -0
- package/dist/connectors/slack/slack-client/src/index.d.ts +1 -0
- package/dist/connectors/slack/slack-client/src/slack-client.d.ts +35 -0
- package/dist/index.js +1 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +743 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +172 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +387 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +50 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +183 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/job.public-types.d.ts +59 -0
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +51 -0
- package/package.json +28 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { UserAiChatModelName } from './backend.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* @category AI
|
|
4
|
+
*/
|
|
5
|
+
export declare const RERANK_PROVIDERS: readonly ["cohere", "none"];
|
|
6
|
+
/**
|
|
7
|
+
* @category AI
|
|
8
|
+
*/
|
|
9
|
+
export type AiRerankProvider = (typeof RERANK_PROVIDERS)[number];
|
|
10
|
+
/** List of available AI provider types. See AiProviderType. */
|
|
11
|
+
export declare const AI_PROVIDER_TYPES: readonly ["anthropic", "flux", "gemini", "openai", "grok", "stability", "voyage", "external"];
|
|
12
|
+
/**
|
|
13
|
+
* Type of the AI provider.
|
|
14
|
+
* References a single AI service, regardless of the model or other AI function it provides (like
|
|
15
|
+
* chat/search/transcribe etc...).
|
|
16
|
+
*/
|
|
17
|
+
export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
|
|
18
|
+
/**
|
|
19
|
+
* @category AI
|
|
20
|
+
*/
|
|
21
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini"];
|
|
22
|
+
/**
|
|
23
|
+
* @category AI
|
|
24
|
+
*/
|
|
25
|
+
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
26
|
+
/**
|
|
27
|
+
* Notes:
|
|
28
|
+
* - 'grok-3-mini' model os ~10x less expensive than 'grok-3'.
|
|
29
|
+
* - '*-fast' models are ~2x more expensive than non-fast variants and only marginally faster.
|
|
30
|
+
* - 'grok-4' cost is comparable to 'grok-3-fast'.
|
|
31
|
+
*
|
|
32
|
+
* @category AI
|
|
33
|
+
*/
|
|
34
|
+
export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
|
|
35
|
+
/**
|
|
36
|
+
* @category AI
|
|
37
|
+
*/
|
|
38
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
|
|
39
|
+
/**
|
|
40
|
+
* The supported AI model names.
|
|
41
|
+
* @category AI
|
|
42
|
+
*/
|
|
43
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
|
|
44
|
+
/**
|
|
45
|
+
* Check if the given model name is a global AI chat model name.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isVendorAiChatModelName(modelName: string): modelName is (typeof VENDOR_AI_CHAT_MODEL_NAMES)[number];
|
|
48
|
+
/**
|
|
49
|
+
* @category AI
|
|
50
|
+
*/
|
|
51
|
+
export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small"];
|
|
52
|
+
/**
|
|
53
|
+
* @category AI
|
|
54
|
+
*/
|
|
55
|
+
export declare const VOYAGE_EMBEDDING_MODEL_NAMES: readonly ["voyage-3-large"];
|
|
56
|
+
/**
|
|
57
|
+
* @category AI
|
|
58
|
+
*/
|
|
59
|
+
export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "voyage-3-large"];
|
|
60
|
+
/**
|
|
61
|
+
* The supported AI image generation model names.
|
|
62
|
+
* @category AI
|
|
63
|
+
*/
|
|
64
|
+
export declare const OPENAI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"];
|
|
65
|
+
/**
|
|
66
|
+
* @category AI
|
|
67
|
+
*/
|
|
68
|
+
export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"];
|
|
69
|
+
/**
|
|
70
|
+
* @category AI
|
|
71
|
+
*/
|
|
72
|
+
export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
|
|
73
|
+
/**
|
|
74
|
+
* @category AI
|
|
75
|
+
*/
|
|
76
|
+
export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
|
|
77
|
+
/**
|
|
78
|
+
* @category AI
|
|
79
|
+
*/
|
|
80
|
+
export declare const STABLE_DIFFUSION_MODEL_NAMES: readonly ["stable-diffusion-core"];
|
|
81
|
+
/**
|
|
82
|
+
* @category AI
|
|
83
|
+
*/
|
|
84
|
+
export declare const FLUX_MODEL_NAMES: readonly ["flux-pro-1.1", "flux-kontext-pro"];
|
|
85
|
+
/**
|
|
86
|
+
* @category AI
|
|
87
|
+
*/
|
|
88
|
+
export declare const AI_IMAGE_MODEL_NAMES: readonly ["dall-e-3", "stable-diffusion-core", "flux-pro-1.1", "flux-kontext-pro"];
|
|
89
|
+
/**
|
|
90
|
+
* @category AI
|
|
91
|
+
*/
|
|
92
|
+
export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"];
|
|
93
|
+
/**
|
|
94
|
+
* @category AI
|
|
95
|
+
*/
|
|
96
|
+
export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
|
|
97
|
+
/**
|
|
98
|
+
* @category AI
|
|
99
|
+
*/
|
|
100
|
+
export declare const OPEN_AI_CREATE_SPEECH_FORMATS: readonly ["mp3", "opus", "aac", "flac", "wav", "pcm"];
|
|
101
|
+
/**
|
|
102
|
+
* @category AI
|
|
103
|
+
*/
|
|
104
|
+
export type VendorAiChatModelName = (typeof VENDOR_AI_CHAT_MODEL_NAMES)[number];
|
|
105
|
+
/**
|
|
106
|
+
* @category AI
|
|
107
|
+
*/
|
|
108
|
+
export type AiChatModelName = VendorAiChatModelName | UserAiChatModelName;
|
|
109
|
+
/**
|
|
110
|
+
* @category AI
|
|
111
|
+
*/
|
|
112
|
+
export type AiEmbeddingsModelName = (typeof AI_EMBEDDINGS_MODEL_NAMES)[number];
|
|
113
|
+
/**
|
|
114
|
+
* @category AI
|
|
115
|
+
*/
|
|
116
|
+
export type AiVoyageEmbeddingsModelName = (typeof VOYAGE_EMBEDDING_MODEL_NAMES)[number];
|
|
117
|
+
/**
|
|
118
|
+
* @category AI
|
|
119
|
+
*/
|
|
120
|
+
export type OpenAiChatModelName = (typeof OPENAI_CHAT_MODEL_NAMES)[number];
|
|
121
|
+
/**
|
|
122
|
+
* @category AI
|
|
123
|
+
*/
|
|
124
|
+
export type GeminiChatModelName = (typeof GEMINI_CHAT_MODEL_NAMES)[number];
|
|
125
|
+
/**
|
|
126
|
+
* @category AI
|
|
127
|
+
*/
|
|
128
|
+
export type GrokChatModelName = (typeof GROK_CHAT_MODEL_NAMES)[number];
|
|
129
|
+
/**
|
|
130
|
+
* @category AI
|
|
131
|
+
*/
|
|
132
|
+
export type AnthropicChatModelName = (typeof ANTHROPIC_CHAT_MODEL_NAMES)[number];
|
|
133
|
+
/**
|
|
134
|
+
* @category AI
|
|
135
|
+
*/
|
|
136
|
+
export type AiImageModelName = (typeof AI_IMAGE_MODEL_NAMES)[number];
|
|
137
|
+
/**
|
|
138
|
+
* @category AI
|
|
139
|
+
*/
|
|
140
|
+
export type AiAudioTranscriptionModelName = (typeof AI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
|
|
141
|
+
/**
|
|
142
|
+
* @category AI
|
|
143
|
+
*/
|
|
144
|
+
export type AiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
|
|
145
|
+
/**
|
|
146
|
+
* @category AI
|
|
147
|
+
*/
|
|
148
|
+
export type AiAudioModelName = (typeof OPENAI_AUDIO_MODEL_NAMES)[number];
|
|
149
|
+
/**
|
|
150
|
+
* @category AI
|
|
151
|
+
*/
|
|
152
|
+
export type OpenAiImageModelName = (typeof OPENAI_IMAGE_MODEL_NAMES)[number];
|
|
153
|
+
/**
|
|
154
|
+
* @category AI
|
|
155
|
+
*/
|
|
156
|
+
export type OpenAiAudioTranscriptionModelName = (typeof OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
|
|
157
|
+
/**
|
|
158
|
+
* @category AI
|
|
159
|
+
*/
|
|
160
|
+
export type OpenAiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
|
|
161
|
+
/**
|
|
162
|
+
* @category AI
|
|
163
|
+
*/
|
|
164
|
+
export type OpenAiCreateSpeechFormat = (typeof OPEN_AI_CREATE_SPEECH_FORMATS)[number];
|
|
165
|
+
/**
|
|
166
|
+
* @category AI
|
|
167
|
+
*/
|
|
168
|
+
export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[number];
|
|
169
|
+
/**
|
|
170
|
+
* @category AI
|
|
171
|
+
*/
|
|
172
|
+
export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { AgentContextRequest, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
|
+
import { AiChatModelName, AiEmbeddingsModelName, AiRerankProvider } from './ai-common.public-types';
|
|
3
|
+
import { AiContextId, AiKnowledgeBaseId, AppId } from './communication.public-types';
|
|
4
|
+
import { DocumentExtractionMethod } from './extraction.public-types';
|
|
5
|
+
/**
|
|
6
|
+
* Represents an AI knowledge base that can be attached to an AI agent.
|
|
7
|
+
* @category AI
|
|
8
|
+
*/
|
|
9
|
+
export interface AiKnowledgeBase {
|
|
10
|
+
/** The unique identifier of the knowledge base.*/
|
|
11
|
+
id: AiKnowledgeBaseId;
|
|
12
|
+
/** The app id that the knowledge base belongs to. */
|
|
13
|
+
appId: AppId;
|
|
14
|
+
/** The user's description of the knowledge base */
|
|
15
|
+
description: string;
|
|
16
|
+
/** A set of predefined metadata fields for the knowledge base that can be used for filtering.*/
|
|
17
|
+
metadataFields: Array<AiKnowledgeBaseMetadataField>;
|
|
18
|
+
/** The embedding model name that should be used for this knowledge base.*/
|
|
19
|
+
embeddingModel: AiEmbeddingsModelName;
|
|
20
|
+
/** The model name that should be used when asking questions of this knowledge base. */
|
|
21
|
+
chatModel: AiChatModelName;
|
|
22
|
+
/** The timestamp the knowledge base was last updated */
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents a field in an AI knowledge base metadata.
|
|
27
|
+
*/
|
|
28
|
+
export interface AiKnowledgeBaseMetadataField {
|
|
29
|
+
/** The name of field.*/
|
|
30
|
+
name: string;
|
|
31
|
+
/** The field data type - used for filtering. For array, only array of strings is supported. */
|
|
32
|
+
dataType: 'string' | 'number' | 'boolean' | 'date' | 'array';
|
|
33
|
+
/** Indicates if the field is required for knowledge base entries.*/
|
|
34
|
+
required: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* In case that the field is required and not provided when uploaded to the knowledge base,
|
|
37
|
+
* this description will be used for extracting the value from the document.
|
|
38
|
+
* Also, it will be used for auto filtering when a prompt is sent to an AI agent.
|
|
39
|
+
*/
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A record of metadata key-value pairs for AI context, where values are primitive types or undefined.
|
|
44
|
+
* @category AI
|
|
45
|
+
*/
|
|
46
|
+
export type AiContextMetadata = Record<string, AiContextMetadataValue>;
|
|
47
|
+
/**
|
|
48
|
+
* @category AI
|
|
49
|
+
*/
|
|
50
|
+
export type AiContextMetadataValue = number | string | boolean | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* @category AI
|
|
53
|
+
*/
|
|
54
|
+
export type AiContextMetadataValueArray = AiContextMetadataValue[];
|
|
55
|
+
interface AiContextMetadataEqFilter {
|
|
56
|
+
$eq: AiContextMetadataValue;
|
|
57
|
+
}
|
|
58
|
+
interface AiContextMetadataNeFilter {
|
|
59
|
+
$ne: AiContextMetadataValue;
|
|
60
|
+
}
|
|
61
|
+
interface AiContextMetadataGtFilter {
|
|
62
|
+
$gt: number;
|
|
63
|
+
}
|
|
64
|
+
interface AiContextMetadataGteFilter {
|
|
65
|
+
$gte: number;
|
|
66
|
+
}
|
|
67
|
+
interface AiContextMetadataLtFilter {
|
|
68
|
+
$lt: number;
|
|
69
|
+
}
|
|
70
|
+
interface AiContextMetadataLteFilter {
|
|
71
|
+
$lte: number;
|
|
72
|
+
}
|
|
73
|
+
interface AiContextMetadataInFilter {
|
|
74
|
+
$in: AiContextMetadataValueArray;
|
|
75
|
+
}
|
|
76
|
+
interface AiContextMetadataNinFilter {
|
|
77
|
+
$nin: AiContextMetadataValueArray;
|
|
78
|
+
}
|
|
79
|
+
interface AiContextMetadataExistsFilter {
|
|
80
|
+
$exists: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @category AI
|
|
84
|
+
*/
|
|
85
|
+
export type AiContextMetadataSimpleFilter = AiContextMetadataEqFilter | AiContextMetadataNeFilter | AiContextMetadataGtFilter | AiContextMetadataGteFilter | AiContextMetadataLtFilter | AiContextMetadataLteFilter | AiContextMetadataInFilter | AiContextMetadataNinFilter | AiContextMetadataExistsFilter;
|
|
86
|
+
/**
|
|
87
|
+
* A filter for AI context metadata based on field-specific conditions or values.
|
|
88
|
+
* @category AI
|
|
89
|
+
*/
|
|
90
|
+
export interface AiContextMetadataFieldFilter {
|
|
91
|
+
/** A record where keys are field names and values are either simple filters or direct metadata values. */
|
|
92
|
+
[field: string]: AiContextMetadataSimpleFilter | AiContextMetadataValue;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A filter combining multiple AI context metadata filters with a logical AND operation.
|
|
96
|
+
* @category AI
|
|
97
|
+
*/
|
|
98
|
+
export interface AiContextMetadataAndFilter {
|
|
99
|
+
/** An array of filters that must all be true for the condition to pass. */
|
|
100
|
+
$and: AiContextMetadataFilter[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A filter combining multiple AI context metadata filters with a logical OR operation.
|
|
104
|
+
* @category AI
|
|
105
|
+
*/
|
|
106
|
+
export interface AiContextMetadataOrFilter {
|
|
107
|
+
/** An array of filters where at least one must be true for the condition to pass. */
|
|
108
|
+
$or: AiContextMetadataFilter[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The options for the AI knowledgebase search method.
|
|
112
|
+
* @category AI
|
|
113
|
+
*/
|
|
114
|
+
export interface AiKnowledgeBaseChatOptions {
|
|
115
|
+
/** A set of filters that will limit the context the AI can access. */
|
|
116
|
+
contextMetadataFilter?: AiContextMetadataFilter;
|
|
117
|
+
/** Whether to include references from the source context in the response. Default to false. */
|
|
118
|
+
includeReference?: boolean;
|
|
119
|
+
/** Include metadata in the context */
|
|
120
|
+
includeMetadata?: boolean;
|
|
121
|
+
/** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
|
|
122
|
+
rerankProvider?: AiRerankProvider;
|
|
123
|
+
/** The maximum number of results to return */
|
|
124
|
+
limit?: number;
|
|
125
|
+
/** How many chunks to look over. Defaults to 100 */
|
|
126
|
+
chunkLimit?: number;
|
|
127
|
+
/** Which chat model to use when asking the question */
|
|
128
|
+
chatModel?: AiChatModelName;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @category AI
|
|
132
|
+
*/
|
|
133
|
+
export type AiContextMetadataFilter = AiContextMetadataFieldFilter | AiContextMetadataAndFilter | AiContextMetadataOrFilter;
|
|
134
|
+
/**
|
|
135
|
+
* Represents an AI knowledge base's context entry with metadata and content.
|
|
136
|
+
* @category AI
|
|
137
|
+
*/
|
|
138
|
+
export interface AiKnowledgeBaseContext {
|
|
139
|
+
/** The unique identifier of the context entry. */
|
|
140
|
+
id: string;
|
|
141
|
+
/** The knowledge base id of the context entry */
|
|
142
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
143
|
+
/** The date and time the context was created. */
|
|
144
|
+
createdAt: Date;
|
|
145
|
+
/** The date and time the context was last updated. */
|
|
146
|
+
updatedAt: Date;
|
|
147
|
+
/** The type of context (e.g., 'text' or 'file'). */
|
|
148
|
+
type: AiKnowledgeBaseContextType;
|
|
149
|
+
/** A title describing the context content. */
|
|
150
|
+
title: string;
|
|
151
|
+
/** The text content of the context. */
|
|
152
|
+
text: string;
|
|
153
|
+
/** Indicates whether the context is a preview; defaults to false. */
|
|
154
|
+
preview: boolean;
|
|
155
|
+
/** The size of the context content in bytes. */
|
|
156
|
+
sizeBytes: number;
|
|
157
|
+
/** Metadata associated with the context. */
|
|
158
|
+
metadata: AiContextMetadata;
|
|
159
|
+
/** Original request configuration for how the context content was processed. */
|
|
160
|
+
requestConfig?: AgentContextRequest;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @category AI
|
|
164
|
+
*/
|
|
165
|
+
export type AiKnowledgeBaseContextType = 'text' | 'file';
|
|
166
|
+
/**
|
|
167
|
+
* @category AI
|
|
168
|
+
*/
|
|
169
|
+
export type AiKnowledgeBaseContextRequest = AiKnowledgeBaseTextContextRequest | AiKnowledgeBaseFileContextRequest;
|
|
170
|
+
interface BaseAiKnowledgeBaseContextRequest {
|
|
171
|
+
contextId: string;
|
|
172
|
+
type: AiKnowledgeBaseContextType;
|
|
173
|
+
metadata?: AiContextMetadata;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Base options for upserting text content into the AI agent's context.
|
|
177
|
+
* @category AI
|
|
178
|
+
*/
|
|
179
|
+
export interface AiKnowledgeBaseContextTextOptions extends BaseAiKnowledgeBaseContextOptions {
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Base options for upserting file content into the AI agent's context.
|
|
183
|
+
* @category AI
|
|
184
|
+
*/
|
|
185
|
+
export interface AiKnowledgeBaseContextFileOptions extends BaseAiKnowledgeBaseContextOptions {
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Request structure for adding text-based context to an AI agent.
|
|
189
|
+
* @category AI
|
|
190
|
+
*/
|
|
191
|
+
export interface AiKnowledgeBaseTextContextRequest extends BaseAiKnowledgeBaseContextRequest {
|
|
192
|
+
/** The id of the context */
|
|
193
|
+
contextId: AiContextId;
|
|
194
|
+
/** Specifies the context type as 'text'. */
|
|
195
|
+
type: 'text';
|
|
196
|
+
/** A title for the text context. */
|
|
197
|
+
title: string;
|
|
198
|
+
/** The text content to add to the context. */
|
|
199
|
+
text: string;
|
|
200
|
+
/** General options for how to process the text. */
|
|
201
|
+
options?: AiKnowledgeBaseContextTextOptions;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Request structure for adding file-based context to an AI agent.
|
|
205
|
+
* @category AI
|
|
206
|
+
*/
|
|
207
|
+
export interface AiKnowledgeBaseFileContextRequest extends BaseAiKnowledgeBaseContextRequest {
|
|
208
|
+
/** The id of the context */
|
|
209
|
+
contextId: AiContextId;
|
|
210
|
+
/** Specifies the context type as 'file'. */
|
|
211
|
+
type: 'file';
|
|
212
|
+
/** Whether to extract images from the file; defaults to false. */
|
|
213
|
+
extractImages?: boolean;
|
|
214
|
+
/** The minimum size for extracted images, if applicable. */
|
|
215
|
+
imageMinSizePixels?: number;
|
|
216
|
+
/** The AI model to use for extraction, if specified. */
|
|
217
|
+
imageExtractionModel?: AiChatModelName;
|
|
218
|
+
/** General options for how to process the file. */
|
|
219
|
+
options?: AiKnowledgeBaseContextFileOptions;
|
|
220
|
+
/** The preferred method for extracting data from the document. */
|
|
221
|
+
preferredExtractionMethod?: DocumentExtractionMethod;
|
|
222
|
+
/**
|
|
223
|
+
* Whether Squid keeps or discards the original file.
|
|
224
|
+
*
|
|
225
|
+
* Keeping the original file allows reprocessing and the ability for the user to download it later.
|
|
226
|
+
*
|
|
227
|
+
* Defaults to false.
|
|
228
|
+
*/
|
|
229
|
+
discardOriginalFile?: boolean;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @category AI
|
|
233
|
+
*/
|
|
234
|
+
export declare const RAG_TYPES: readonly ["contextual", "basic"];
|
|
235
|
+
/**
|
|
236
|
+
* @category AI
|
|
237
|
+
*/
|
|
238
|
+
export type AiRagType = (typeof RAG_TYPES)[number];
|
|
239
|
+
/**
|
|
240
|
+
* Base options for how to deal with the content being upserted.
|
|
241
|
+
* @category AI
|
|
242
|
+
*/
|
|
243
|
+
export type BaseAiKnowledgeBaseContextOptions = {
|
|
244
|
+
/** The type of RAG to use for the content. */
|
|
245
|
+
ragType?: AiRagType;
|
|
246
|
+
/** Amount of chunk overlap, in characters. */
|
|
247
|
+
chunkOverlap?: number;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Specific options for the AI knowledgebase search method.
|
|
251
|
+
* @category AI
|
|
252
|
+
*/
|
|
253
|
+
export interface AiKnowledgeBaseSearchOptions {
|
|
254
|
+
/** The prompt to search for */
|
|
255
|
+
prompt: string;
|
|
256
|
+
/** The maximum number of results to return */
|
|
257
|
+
limit?: number;
|
|
258
|
+
/** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
|
|
259
|
+
rerankProvider?: AiRerankProvider;
|
|
260
|
+
/** How many chunks to look over. Defaults to 100 */
|
|
261
|
+
chunkLimit?: number;
|
|
262
|
+
/** Which chat model to use when asking the question */
|
|
263
|
+
chatModel?: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* A single chunk of data returned from an AI search operation.
|
|
267
|
+
* @category AI
|
|
268
|
+
*/
|
|
269
|
+
export interface AiKnowledgeBaseSearchResultChunk {
|
|
270
|
+
/** The unique identifier of the context. */
|
|
271
|
+
contextId: string;
|
|
272
|
+
/** The data content of the search result chunk. */
|
|
273
|
+
data: string;
|
|
274
|
+
/** Optional metadata associated with the chunk. */
|
|
275
|
+
metadata?: AiContextMetadata;
|
|
276
|
+
/** The relevance score of the chunk, indicating match quality. */
|
|
277
|
+
score: number;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Response structure for upserting context for an AiKnowledgeBase
|
|
281
|
+
* @category AI
|
|
282
|
+
*/
|
|
283
|
+
export interface UpsertKnowledgeBaseContextResponse {
|
|
284
|
+
/** List of the upsert status of each item sent in the request. */
|
|
285
|
+
failure?: UpsertContextStatusError;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Response structure for upserting contexts for an AiKnowledgeBase
|
|
289
|
+
* @category AI
|
|
290
|
+
*/
|
|
291
|
+
export interface UpsertKnowledgeBaseContextsResponse {
|
|
292
|
+
/** List of the upsert status of each item sent in the request. */
|
|
293
|
+
failures: Array<UpsertContextStatusError>;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Request structure for searching an AiKnowledgeBase
|
|
297
|
+
* @category AI
|
|
298
|
+
*/
|
|
299
|
+
export interface AiKnowledgeBaseSearchRequest {
|
|
300
|
+
/** The id of the AiKnowledgeBase */
|
|
301
|
+
knowledgeBaseId: string;
|
|
302
|
+
/** The user prompt to search on */
|
|
303
|
+
prompt: string;
|
|
304
|
+
/** The search options for this search */
|
|
305
|
+
options: AiKnowledgeBaseSearchOptions;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Request structure for searching AI contexts in the AiKnowledgeBase.
|
|
309
|
+
* @category AI
|
|
310
|
+
*/
|
|
311
|
+
export interface BaseAiKnowledgeBaseSearchContextsRequest {
|
|
312
|
+
/** The id of the AiKnowledgeBase */
|
|
313
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
314
|
+
/** The maximum number of results to return */
|
|
315
|
+
limit?: number;
|
|
316
|
+
/** A set of filters that will limit the context the AI can access. */
|
|
317
|
+
contextMetadataFilter?: AiContextMetadataFilter;
|
|
318
|
+
/** Whether to rerank the results with AI and provide reasoning - defaults to true */
|
|
319
|
+
rerank?: boolean;
|
|
320
|
+
/** Which chat model to use when doing reranking */
|
|
321
|
+
chatModel?: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Request structure for searching AI contexts in the AiKnowledgeBase with prompt.
|
|
325
|
+
* @category AI
|
|
326
|
+
*/
|
|
327
|
+
export interface AiKnowledgeBaseSearchContextsWithPromptRequest extends BaseAiKnowledgeBaseSearchContextsRequest {
|
|
328
|
+
/** The user prompt to search on */
|
|
329
|
+
prompt: string;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Request structure for searching AI contexts in the AiKnowledgeBase with an existing context.
|
|
333
|
+
* @category AI
|
|
334
|
+
*/
|
|
335
|
+
export interface AiKnowledgeBaseSearchContextsWithContextIdRequest extends BaseAiKnowledgeBaseSearchContextsRequest {
|
|
336
|
+
/** The contextId to search with */
|
|
337
|
+
contextId: string;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* A context with reasoning and matching score.
|
|
341
|
+
* @category AI
|
|
342
|
+
*/
|
|
343
|
+
export interface AiKnowledgeBaseContextWithReasoning {
|
|
344
|
+
/** The actual context */
|
|
345
|
+
context: AiKnowledgeBaseContext;
|
|
346
|
+
/** The reasoning behind why this context was matched - can be undefined if no reasoning was requested */
|
|
347
|
+
reasoning?: string;
|
|
348
|
+
/** The score of the match, ranging from 0 to 100, where 100 is the best match. */
|
|
349
|
+
score: number;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Response structure for searching contexts in an AiKnowledgeBase.
|
|
353
|
+
* @category AI
|
|
354
|
+
*/
|
|
355
|
+
export interface AiKnowledgeBaseSearchContextsResponse {
|
|
356
|
+
/** The resulting contexts, with reasoning if it was requested */
|
|
357
|
+
results: Array<AiKnowledgeBaseContextWithReasoning>;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Request structure for requesting a download link to the context file that you previously provided.
|
|
361
|
+
* @category AI
|
|
362
|
+
*/
|
|
363
|
+
export interface AiKnowledgeBaseDownloadContextRequest {
|
|
364
|
+
/** The id of the AiKnowledgeBase */
|
|
365
|
+
knowledgeBaseId: string;
|
|
366
|
+
/** The id of the particular AiKnowledgeBaseContext */
|
|
367
|
+
contextId: string;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Response structure with the URL to download the specified context.
|
|
371
|
+
*
|
|
372
|
+
* Can be undefined if the file is not available in Squid.
|
|
373
|
+
* @category AI
|
|
374
|
+
*/
|
|
375
|
+
export interface AiKnowledgeBaseDownloadContextResponse {
|
|
376
|
+
/** The URL to download the file, if available. */
|
|
377
|
+
url?: string;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* KnowledgeBase with optional chatModel param, used during upsert
|
|
381
|
+
* @category AI
|
|
382
|
+
*/
|
|
383
|
+
export type AiKnowledgeBaseWithOptionalChatModel = Omit<AiKnowledgeBase, 'chatModel'> & {
|
|
384
|
+
chatModel?: AiKnowledgeBase['chatModel'];
|
|
385
|
+
name?: string;
|
|
386
|
+
};
|
|
387
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Backend related public types that should be available on the client SDK */
|
|
2
|
+
/** A type alias for a string that represents an AI function ID. */
|
|
3
|
+
export type AiFunctionId = string;
|
|
4
|
+
/** A type alias for a string that represents an AI functions configurator ID. */
|
|
5
|
+
export type AiFunctionsConfiguratorId = string;
|
|
6
|
+
/**
|
|
7
|
+
* A type alias for a service identifier.
|
|
8
|
+
* @category Queue
|
|
9
|
+
*/
|
|
10
|
+
export type TopicName = string;
|
|
11
|
+
/** A type alias for a service class name. */
|
|
12
|
+
export type ServiceName = string;
|
|
13
|
+
/** A type alias for a function name within a service. */
|
|
14
|
+
export type FunctionName = string;
|
|
15
|
+
/**
|
|
16
|
+
* Function name with contextual data, where the data must be serializable as JSON.
|
|
17
|
+
*/
|
|
18
|
+
export interface AiFunctionIdWithContext {
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the AI function as described in @aiFunction decorator.
|
|
21
|
+
* Historically named as 'name' because AI function name is the default value for 'ID'.
|
|
22
|
+
*/
|
|
23
|
+
name: AiFunctionId;
|
|
24
|
+
/** A record of contextual data associated with the function call. */
|
|
25
|
+
context?: Record<string, unknown>;
|
|
26
|
+
/** A list of predefined parameter values for the AI function. These parameters are hidden from the AI. */
|
|
27
|
+
predefinedParameters?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A combined service and function name in the format 'ServiceName:FunctionName'.
|
|
31
|
+
* Uniquely identifies a function within a service.
|
|
32
|
+
*/
|
|
33
|
+
export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
|
|
34
|
+
/**
|
|
35
|
+
* LLM model name for use in API calls, eg. "gpt-4o-mini".
|
|
36
|
+
*/
|
|
37
|
+
export type UserAiChatModelName = string;
|
|
38
|
+
/**
|
|
39
|
+
* Stats about a given LLM model.
|
|
40
|
+
*/
|
|
41
|
+
export type LlmModelMetadata = {
|
|
42
|
+
/**
|
|
43
|
+
* A friendly name for the model, to display in UIs.
|
|
44
|
+
*/
|
|
45
|
+
displayName: string;
|
|
46
|
+
/** Maximum tokens the model can generate in a single response. */
|
|
47
|
+
maxOutputTokens: number;
|
|
48
|
+
/** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
|
|
49
|
+
contextWindowTokens: number;
|
|
50
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A type alias for an application id. */
|
|
2
|
+
export type AppId = string;
|
|
3
|
+
/** A tuple of environment identifiers like 'dev' or 'prod'. */
|
|
4
|
+
export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
|
|
5
|
+
/** A type representing valid environment identifiers derived from ENVIRONMENT_IDS. */
|
|
6
|
+
export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
|
|
7
|
+
/** A type alias for a squid developer identifier. */
|
|
8
|
+
export type SquidDeveloperId = string;
|
|
9
|
+
/** A type alias for an integration id. */
|
|
10
|
+
export type IntegrationId = string;
|
|
11
|
+
/** A type alias for a client identifier. */
|
|
12
|
+
export type ClientId = string;
|
|
13
|
+
/** A type alias for a squid document identifier. */
|
|
14
|
+
export type SquidDocId = string;
|
|
15
|
+
/** A type alias for a client request identifier. */
|
|
16
|
+
export type ClientRequestId = string;
|
|
17
|
+
/** ID of AI agent. Also known as AI profile id. */
|
|
18
|
+
export type AiAgentId = string;
|
|
19
|
+
/** App-level ID of AI Knowledge Base */
|
|
20
|
+
export type AiKnowledgeBaseId = string;
|
|
21
|
+
/**
|
|
22
|
+
* The built-in agent id. Cannot be customized.
|
|
23
|
+
* @category AI
|
|
24
|
+
*/
|
|
25
|
+
export declare const BUILT_IN_AGENT_ID = "built_in_agent";
|
|
26
|
+
/**
|
|
27
|
+
* A type alias for an AI context identifier.
|
|
28
|
+
* @category AI
|
|
29
|
+
*/
|
|
30
|
+
export type AiContextId = string;
|