feat(ai): improve runtime capability reporting and context settings
Add explicit chat capability tracking, expose formatted runtime capabilities in the info command, and support a max context size option for user AI settings. Also update Ollama base URL resolution to use OLLAMA_ADDRESS and simplify provider chat command execution.
This commit is contained in:
+2
-14
@@ -90,7 +90,8 @@ export function searchChatCommand(
|
||||
botUsername: string | undefined = botUser.username
|
||||
): Command | null {
|
||||
for (const command of commands) {
|
||||
const match = command.finalRegexp.exec(text);
|
||||
const finalRegexp = command.finalRegexp;
|
||||
const match = finalRegexp.exec(text);
|
||||
if (!match) continue;
|
||||
|
||||
const mentioned = match[2]?.toLowerCase();
|
||||
@@ -2089,19 +2090,6 @@ export function photoPathByUniqueId(uniqueId: string): string {
|
||||
return path.join(photoDir, uniqueId + ".jpg");
|
||||
}
|
||||
|
||||
export function getCurrentModel(): string | undefined {
|
||||
switch (Environment.DEFAULT_AI_PROVIDER) {
|
||||
case AiProvider.OLLAMA:
|
||||
return Environment.OLLAMA_CHAT_MODEL;
|
||||
case AiProvider.GEMINI:
|
||||
return Environment.GEMINI_MODEL;
|
||||
case AiProvider.MISTRAL:
|
||||
return Environment.MISTRAL_MODEL;
|
||||
case AiProvider.OPENAI:
|
||||
return Environment.OPENAI_MODEL;
|
||||
}
|
||||
}
|
||||
|
||||
export async function processMyChatMember(u: ChatMemberUpdated): Promise<void> {
|
||||
console.log("my_chat_member", u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user