@realtimex/sdk 1.3.2 → 1.3.3
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/README.md +13 -0
- package/dist/index.d.mts +29 -2
- package/dist/index.d.ts +29 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -167,6 +167,19 @@ const response = await sdk.llm.chat(
|
|
|
167
167
|
);
|
|
168
168
|
console.log(response.response?.content);
|
|
169
169
|
|
|
170
|
+
// Multimodal Chat (text + file/image blocks)
|
|
171
|
+
const multimodal = await sdk.llm.chat([
|
|
172
|
+
{
|
|
173
|
+
role: 'user',
|
|
174
|
+
content: [
|
|
175
|
+
{ type: 'text', text: 'Summarize the attached document' },
|
|
176
|
+
{ type: 'input_file', file_url: 'https://example.com/report.pdf' },
|
|
177
|
+
{ type: 'input_image', image_url: 'https://example.com/chart.png' }
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
]);
|
|
181
|
+
console.log(multimodal.response?.content);
|
|
182
|
+
|
|
170
183
|
// Streaming Chat
|
|
171
184
|
for await (const chunk of sdk.llm.chatStream(messages, options)) {
|
|
172
185
|
process.stdout.write(chunk.textResponse || '');
|
package/dist/index.d.mts
CHANGED
|
@@ -380,9 +380,36 @@ declare class PortModule {
|
|
|
380
380
|
* - Vector storage (upsert, query, delete)
|
|
381
381
|
*/
|
|
382
382
|
|
|
383
|
+
interface ChatTextBlock {
|
|
384
|
+
type: 'text' | 'input_text';
|
|
385
|
+
text: string;
|
|
386
|
+
[key: string]: unknown;
|
|
387
|
+
}
|
|
388
|
+
interface ChatImageUrlBlock {
|
|
389
|
+
type: 'image_url' | 'input_image';
|
|
390
|
+
image_url: string | {
|
|
391
|
+
url: string;
|
|
392
|
+
detail?: 'auto' | 'low' | 'high';
|
|
393
|
+
[key: string]: unknown;
|
|
394
|
+
};
|
|
395
|
+
[key: string]: unknown;
|
|
396
|
+
}
|
|
397
|
+
interface ChatFileBlock {
|
|
398
|
+
type: 'input_file' | 'file';
|
|
399
|
+
file_url?: string;
|
|
400
|
+
file_id?: string;
|
|
401
|
+
filename?: string;
|
|
402
|
+
[key: string]: unknown;
|
|
403
|
+
}
|
|
404
|
+
interface ChatCustomBlock {
|
|
405
|
+
type: string;
|
|
406
|
+
[key: string]: unknown;
|
|
407
|
+
}
|
|
408
|
+
type ChatContentBlock = ChatTextBlock | ChatImageUrlBlock | ChatFileBlock | ChatCustomBlock;
|
|
409
|
+
type ChatMessageContent = string | ChatContentBlock[];
|
|
383
410
|
interface ChatMessage {
|
|
384
411
|
role: 'system' | 'user' | 'assistant';
|
|
385
|
-
content:
|
|
412
|
+
content: ChatMessageContent;
|
|
386
413
|
}
|
|
387
414
|
interface ChatOptions {
|
|
388
415
|
model?: string;
|
|
@@ -1006,4 +1033,4 @@ declare class RealtimeXSDK {
|
|
|
1006
1033
|
getAppDataDir(): Promise<string>;
|
|
1007
1034
|
}
|
|
1008
1035
|
|
|
1009
|
-
export { ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, type ChatMessage, type ChatOptions, type ChatResponse, type EmbedOptions, type EmbedResponse, LLMModule, LLMPermissionError, LLMProviderError, PermissionDeniedError, PermissionRequiredError, PortModule, type Provider, type ProvidersResponse, RealtimeXSDK, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, type StreamChunk, type StreamChunkEvent, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace };
|
|
1036
|
+
export { ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, type ChatContentBlock, type ChatCustomBlock, type ChatFileBlock, type ChatImageUrlBlock, type ChatMessage, type ChatMessageContent, type ChatOptions, type ChatResponse, type ChatTextBlock, type EmbedOptions, type EmbedResponse, LLMModule, LLMPermissionError, LLMProviderError, PermissionDeniedError, PermissionRequiredError, PortModule, type Provider, type ProvidersResponse, RealtimeXSDK, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, type StreamChunk, type StreamChunkEvent, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace };
|
package/dist/index.d.ts
CHANGED
|
@@ -380,9 +380,36 @@ declare class PortModule {
|
|
|
380
380
|
* - Vector storage (upsert, query, delete)
|
|
381
381
|
*/
|
|
382
382
|
|
|
383
|
+
interface ChatTextBlock {
|
|
384
|
+
type: 'text' | 'input_text';
|
|
385
|
+
text: string;
|
|
386
|
+
[key: string]: unknown;
|
|
387
|
+
}
|
|
388
|
+
interface ChatImageUrlBlock {
|
|
389
|
+
type: 'image_url' | 'input_image';
|
|
390
|
+
image_url: string | {
|
|
391
|
+
url: string;
|
|
392
|
+
detail?: 'auto' | 'low' | 'high';
|
|
393
|
+
[key: string]: unknown;
|
|
394
|
+
};
|
|
395
|
+
[key: string]: unknown;
|
|
396
|
+
}
|
|
397
|
+
interface ChatFileBlock {
|
|
398
|
+
type: 'input_file' | 'file';
|
|
399
|
+
file_url?: string;
|
|
400
|
+
file_id?: string;
|
|
401
|
+
filename?: string;
|
|
402
|
+
[key: string]: unknown;
|
|
403
|
+
}
|
|
404
|
+
interface ChatCustomBlock {
|
|
405
|
+
type: string;
|
|
406
|
+
[key: string]: unknown;
|
|
407
|
+
}
|
|
408
|
+
type ChatContentBlock = ChatTextBlock | ChatImageUrlBlock | ChatFileBlock | ChatCustomBlock;
|
|
409
|
+
type ChatMessageContent = string | ChatContentBlock[];
|
|
383
410
|
interface ChatMessage {
|
|
384
411
|
role: 'system' | 'user' | 'assistant';
|
|
385
|
-
content:
|
|
412
|
+
content: ChatMessageContent;
|
|
386
413
|
}
|
|
387
414
|
interface ChatOptions {
|
|
388
415
|
model?: string;
|
|
@@ -1006,4 +1033,4 @@ declare class RealtimeXSDK {
|
|
|
1006
1033
|
getAppDataDir(): Promise<string>;
|
|
1007
1034
|
}
|
|
1008
1035
|
|
|
1009
|
-
export { ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, type ChatMessage, type ChatOptions, type ChatResponse, type EmbedOptions, type EmbedResponse, LLMModule, LLMPermissionError, LLMProviderError, PermissionDeniedError, PermissionRequiredError, PortModule, type Provider, type ProvidersResponse, RealtimeXSDK, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, type StreamChunk, type StreamChunkEvent, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace };
|
|
1036
|
+
export { ActivitiesModule, type Activity, type Agent, type AgentChatOptions, type AgentChatResponse, AgentModule, type AgentSession, type AgentSessionInfo, type AgentSessionOptions, ApiModule, type ChatContentBlock, type ChatCustomBlock, type ChatFileBlock, type ChatImageUrlBlock, type ChatMessage, type ChatMessageContent, type ChatOptions, type ChatResponse, type ChatTextBlock, type EmbedOptions, type EmbedResponse, LLMModule, LLMPermissionError, LLMProviderError, PermissionDeniedError, PermissionRequiredError, PortModule, type Provider, type ProvidersResponse, RealtimeXSDK, type SDKConfig, type STTListenOptions, type STTModel, type STTModelsResponse, STTModule, type STTProvider, type STTProvidersResponse, type STTResponse, type StreamChunk, type StreamChunkEvent, type TTSChunk, type TTSChunkEvent, TTSModule, type TTSOptions, type TTSProvider, type TTSProviderConfig, type TTSProvidersResponse, type Task, TaskModule, type TaskRun, type Thread, type TriggerAgentPayload, type TriggerAgentResponse, type VectorDeleteOptions, type VectorDeleteResponse, type VectorQueryOptions, type VectorQueryResponse, type VectorQueryResult, type VectorRecord, VectorStore, type VectorUpsertOptions, type VectorUpsertResponse, WebhookModule, type Workspace };
|