Skip to content

Commit ed4a544

Browse files
authored
Merge branch 'master' into luma-video
2 parents 15b290d + 1118040 commit ed4a544

File tree

22 files changed

+773
-275
lines changed

22 files changed

+773
-275
lines changed

src/bot.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import { LlamaAgent } from './modules/subagents'
6060
import { llmModelManager } from './modules/llms/utils/llmModelsManager'
6161
import { HmnyBot } from './modules/hmny'
6262
import { LumaBot } from './modules/llms/lumaBot'
63+
import { XaiBot } from './modules/llms/xaiBot'
6364

6465
Events.EventEmitter.defaultMaxListeners = 30
6566

@@ -186,10 +187,7 @@ bot.use(async (ctx: BotContext, next: NextFunction): Promise<void> => {
186187

187188
bot.use(
188189
session({
189-
initial: () => {
190-
logger.info('Creating new session')
191-
return createInitialSessionData()
192-
},
190+
initial: createInitialSessionData,
193191
storage: enhanceStorage<BotSessionData>({
194192
storage: new MemorySessionStorage<Enhance<BotSessionData>>(),
195193
millisecondsToLive: config.sessionTimeout * 60 * 60 * 1000 // 48 hours
@@ -213,6 +211,7 @@ const dalleBot = new DalleBot(payments)
213211
const lumaBot = new LumaBot(payments)
214212
const claudeBot = new ClaudeBot(payments)
215213
const vertexBot = new VertexBot(payments, [llamaAgent])
214+
const xaiBot = new XaiBot(payments)
216215
const oneCountryBot = new OneCountryBot(payments)
217216
const translateBot = new TranslateBot()
218217
const telegramPayments = new TelegramPayments(payments)
@@ -343,6 +342,7 @@ const PayableBots: Record<string, PayableBotConfig> = {
343342
claudeBot: { bot: claudeBot },
344343
vertexBot: { bot: vertexBot },
345344
lumaBot: { bot: lumaBot },
345+
aixBot: { bot: xaiBot },
346346
openAiBot: {
347347
enabled: (ctx: OnMessageContext) => ctx.session.dalle.isEnabled,
348348
bot: openAiBot
@@ -538,7 +538,6 @@ bot.command('support', async (ctx) => {
538538

539539
bot.command('models', async (ctx) => {
540540
const models = llmModelManager.generateTelegramOutput()
541-
console.log(models)
542541
writeCommandLog(ctx as OnMessageContext).catch(logErrorHandler)
543542
return await ctx.reply(models, {
544543
parse_mode: 'Markdown',

src/config.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default {
4040
apiEndpoint: 'http://127.0.0.1:5000', // // process.env.LLMS_ENDPOINT, // 'http://127.0.0.1:5000',
4141
apiKey: process.env.LLMS_API_KEY ?? '',
4242
wordLimit: 50,
43-
model: 'chat-bison',
43+
model: 'gpt-4o',
4444
minimumBalance: 0,
4545
isEnabled: Boolean(parseInt(process.env.LLMS_ENABLED ?? '1')),
4646
pdfUrl: process.env.PDF_URL ?? '',
@@ -53,7 +53,7 @@ export default {
5353
telegramFileUrl: 'https://api.telegram.org/file/bot',
5454
completions: {
5555
temperature:
56-
(parseInt(process.env.OPENAI_TEMPERATURE ?? '')) ??
56+
(parseFloat(process.env.OPENAI_TEMPERATURE ?? '')) ??
5757
0.8
5858
},
5959
defaultPrompt:
@@ -145,11 +145,10 @@ export default {
145145
schedule: {
146146
isEnabled: Boolean(parseInt(process.env.SCHEDULE_IS_ENABLED ?? '0')),
147147
chatId: process.env.SCHEDULE_CHAT_ID ?? '',
148-
explorerRestApiUrl: process.env.EXPLORER_REST_API_URL ?? '',
149-
explorerRestApiKey: process.env.EXPLORER_REST_API_KEY ?? '',
148+
explorerRestApiUrl: process.env.EXPLORER_REST_API_URL ?? 'https://stats.explorer.harmony.one',
150149
swapSubgraphApiUrl:
151150
process.env.SWAP_SUBGRAPH_API_URL ??
152-
'https://api.thegraph.com/subgraphs/name/nick8319/uniswap-v3-harmony' // 'https://api.thegraph.com/subgraphs/name/potvik/uniswap-v3-harmony'
151+
'https://gateway.thegraph.com/api/c568be64f7d1d4d4739d3881b5e09fc6/subgraphs/id/GVkp9F6TzzC5hY4g18Ukzb6gGcYDfQrpMpcj867jsenJ' // 'https://api.thegraph.com/subgraphs/name/potvik/uniswap-v3-harmony'
153152
},
154153
walletConnect: { projectId: process.env.WALLET_CONNECT_PROJECT_ID ?? '' },
155154
voiceTranslate: { isEnabled: Boolean(parseInt(process.env.BOT_VOICE_TRANSLATE_ENABLE ?? '0')) },
@@ -159,7 +158,7 @@ export default {
159158
maxChatsWhitelist: (process.env.CREDITS_CHATS_WHITELIST ?? '')
160159
.split(',')
161160
.map((item) => item.toString().toLowerCase()),
162-
creditsAmount: '100'
161+
creditsAmount: '100' // todo: handle multiple credits numbers (+ dateSince), considering future number change.
163162
},
164163
betteruptime: { botHeartBitId: process.env.BOT_HEARTBIT_ID ?? '' },
165164
telegramPayments: { token: process.env.TELEGRAM_PAYMENTS_TOKEN ?? '' },

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export const PROMPTS = {
287287
}
288288

289289
export const VOICE_MEMO_FORWARDING = {
290-
enabled: 'Voice note forwarding is now active. The next voice note you send will be forwarded automatically. This setting will deactivate after forwarding one voice note.',
290+
enabled: 'Voice note forwarding is now active. The next voice note you send will be processed automatically. This setting will deactivate after processing the voice note.',
291291
restricted: 'Sorry, voice note forwarding can only be enabled by admin users. If you need this feature, please contact an admin for assistance.'
292292
}
293293

0 commit comments

Comments
 (0)