opc-agent 4.0.6 → 4.0.8
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.
|
@@ -169,8 +169,18 @@ class TelegramChannel extends index_1.BaseChannel {
|
|
|
169
169
|
chatType: message.chat.type,
|
|
170
170
|
},
|
|
171
171
|
};
|
|
172
|
-
|
|
173
|
-
await this.
|
|
172
|
+
// Show typing indicator while processing
|
|
173
|
+
await this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' });
|
|
174
|
+
const typingInterval = setInterval(() => {
|
|
175
|
+
this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' }).catch(() => { });
|
|
176
|
+
}, 4000);
|
|
177
|
+
try {
|
|
178
|
+
const response = await this.handler(msg);
|
|
179
|
+
await this.sendMessage(message.chat.id, response.content);
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
clearInterval(typingInterval);
|
|
183
|
+
}
|
|
174
184
|
}
|
|
175
185
|
async sendMessage(chatId, text) {
|
|
176
186
|
// Telegram max message length is 4096
|
package/dist/providers/index.js
CHANGED
|
@@ -434,7 +434,7 @@ function createProvider(name = 'openai', model, baseUrl, apiKey) {
|
|
|
434
434
|
else if (finalBaseUrl.includes('dashscope.aliyuncs.com')) {
|
|
435
435
|
resolvedName = 'qwen';
|
|
436
436
|
}
|
|
437
|
-
return new OpenAICompatibleProvider(resolvedName, finalModel,
|
|
437
|
+
return new OpenAICompatibleProvider(resolvedName, finalModel, finalBaseUrl, finalKey);
|
|
438
438
|
}
|
|
439
439
|
exports.SUPPORTED_PROVIDERS = ['openai', 'ollama', 'claude-cli', 'deepseek', 'qwen', 'gemini', 'dashscope', 'zhipu', 'moonshot'];
|
|
440
440
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
package/src/channels/telegram.ts
CHANGED
|
@@ -170,8 +170,18 @@ export class TelegramChannel extends BaseChannel {
|
|
|
170
170
|
},
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
await this.
|
|
173
|
+
// Show typing indicator while processing
|
|
174
|
+
await this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' });
|
|
175
|
+
const typingInterval = setInterval(() => {
|
|
176
|
+
this.apiCall('sendChatAction', { chat_id: message.chat.id, action: 'typing' }).catch(() => {});
|
|
177
|
+
}, 4000);
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
const response = await this.handler(msg);
|
|
181
|
+
await this.sendMessage(message.chat.id, response.content);
|
|
182
|
+
} finally {
|
|
183
|
+
clearInterval(typingInterval);
|
|
184
|
+
}
|
|
175
185
|
}
|
|
176
186
|
|
|
177
187
|
async sendMessage(chatId: number | string, text: string): Promise<void> {
|
package/src/providers/index.ts
CHANGED
|
@@ -444,7 +444,7 @@ export function createProvider(name: string = 'openai', model?: string, baseUrl?
|
|
|
444
444
|
resolvedName = 'qwen';
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
return new OpenAICompatibleProvider(resolvedName, finalModel,
|
|
447
|
+
return new OpenAICompatibleProvider(resolvedName, finalModel, finalBaseUrl, finalKey);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
export const SUPPORTED_PROVIDERS = ['openai', 'ollama', 'claude-cli', 'deepseek', 'qwen', 'gemini', 'dashscope', 'zhipu', 'moonshot'] as const;
|