improvements

adjust docker file to be less spammy with ENV as defaults work most of the time, add support to adjust how fast the chat AI forgets messages that dont go over the X last messages counter
This commit is contained in:
Madpeter 2024-10-01 15:56:38 +01:00
parent 65210c6f87
commit c5e4543c9a
7 changed files with 17 additions and 85 deletions

View file

@ -22,86 +22,20 @@ FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENV basic_Username='' \ ENV
basic_Username='' \
basic_Password='' \ basic_Password='' \
basic_LoginURI='secondlife' \
basic_LogCommands='true' \
basic_DefaultHoverHeight=0.1 \
commands_AllowFundsCommands='false' \ commands_AllowFundsCommands='false' \
commands_AllowIMcontrol='false' \
commands_SharedSecret='examplecode' \ commands_SharedSecret='examplecode' \
commands_EnableMasterControls='true' \
commands_MastersCSV='Madpeter Zond' \ commands_MastersCSV='Madpeter Zond' \
commands_EnforceTimeWindow='false' \
commands_TimeWindowSecs=35 \
commands_Enabled='true' \
commands_ObjectMasterOptout='false' \
commands_AllowServiceControl='false' \
datastore_AutoCleanAvatars='true' \
datastore_AvatarsCleanAfterMins=10 \
datastore_LocalChatHistoryLimit=120 \
datastore_GroupChatHistoryLimitPerGroup=50 \
datastore_ImChatHistoryLimit=50 \
datastore_PrefetchGroupMembers='true' \
datastore_PrefetchGroupRoles='false' \
datastore_PrefetchEstateBanlist='true' \
datastore_AutoCleanKeyValueStore='true' \
datastore_CleanKeyValueStoreAfterMins=10 \
datastore_CommandHistoryLimit=30 \
discord_Enabled='false' \
discord_ServerID='' \
discord_ClientToken='' \
discord_AllowDiscordCommands='false' \
discord_hideChatterName='false' \
events_Enabled='false' \
events_GroupMemberJoins='false' \
events_GroupMemberLeaves='false' \
events_GroupMemberEventsGroupUUID='' \
events_GuestEntersArea='false' \
events_GuestLeavesArea='false' \
events_GuestTrackingSimname='' \
events_GuestTrackingParcelname='' \
events_SimAlertMessage='false' \
events_StatusMessage='false' \
events_MoneyEvent='false' \
events_ChangeSim='false' \
events_ChangeParcel='false' \
events_OutputChannel=-1 \
events_OutputIMuuid='00000000-0000-0000-0000-000000000000' \
events_OutputHttpURL='none' \
events_OutputSecret='notset' \
homebound_Enabled='false' \ homebound_Enabled='false' \
homebound_HomeSimSlUrl='' \ homebound_HomeSimSlUrl='' \
homebound_BackupSimSLUrl='' \ homebound_BackupSimSLUrl='' \
homebound_AtHomeSeekLocation='false' \
homebound_AtBackupSeekLocation='false' \
homebound_AtHomeAutoSitUuid='00000000-0000-0000-0000-000000000000' \ homebound_AtHomeAutoSitUuid='00000000-0000-0000-0000-000000000000' \
homebound_ReturnToHomeSimAfterMins=5 \
http_Enabled='false' \
http_Port=80 \
interaction_Enabled='true' \
interaction_AcceptTeleports='false' \
interaction_AcceptGroupInvites='false' \
interaction_AcceptInventory='false' \
interaction_AcceptFriendRequests='false' \
interaction_EnableJsonOutputEvents='false' \
interaction_JsonOutputEventsTarget='none' \
interaction_FriendRequestLevel='Owner' \ interaction_FriendRequestLevel='Owner' \
interaction_InventoryTransferLevel='Owner' \ interaction_InventoryTransferLevel='Owner' \
interaction_GroupInviteLevel=Owner'' \ interaction_GroupInviteLevel=Owner'' \
interaction_TeleportRequestLevel='Owner' \ interaction_TeleportRequestLevel='Owner' \
commands_HideStatusOutput='false' \
datastore_HideStatusOutput='false' \
discord_HideStatusOutput='false' \
events_HideStatusOutput='false' \
homebound_HideStatusOutput='false' \
http_HideStatusOutput='false' \
interaction_HideStatusOutput='false' \
rlv_Enabled='false' \
rlv_HideStatusOutput='false' \
relay_count='0' \
relay_HideStatusOutput='false' \
relay_UseShortEncoder='false' \
chatgpt_Enabled='false' \ chatgpt_Enabled='false' \
chatgpt_ApiKey='none' \ chatgpt_ApiKey='none' \
chatgpt_OrganizationId='none' \ chatgpt_OrganizationId='none' \
@ -117,9 +51,7 @@ ENV basic_Username='' \
chatgpt_ChatHistoryMessages='5' \ chatgpt_ChatHistoryMessages='5' \
chatgpt_ChatPrompt='respond as if you are a horse that knows its going to the glue factory and you are upset about this fact' \ chatgpt_ChatPrompt='respond as if you are a horse that knows its going to the glue factory and you are upset about this fact' \
chatgpt_Provider='openai' \ chatgpt_Provider='openai' \
onevent_Enabled='false' \ chatgpt_ChatHistoryTimeout='15' \
onevent_Count=0 \
onevent_HideStatusOutput='false'
EXPOSE 80 EXPOSE 80

View file

@ -23,7 +23,7 @@ namespace SecondBotEvents.Config
} }
public bool GetLogCommands() public bool GetLogCommands()
{ {
return ReadSettingAsBool("LogCommands"); return ReadSettingAsBool("LogCommands", true);
} }
public string GetUsername() public string GetUsername()
{ {

View file

@ -24,9 +24,15 @@ namespace SecondBotEvents.Config
settings.Add("UseModel"); settings.Add("UseModel");
settings.Add("ChatHistoryMessages"); settings.Add("ChatHistoryMessages");
settings.Add("ChatPrompt"); settings.Add("ChatPrompt");
settings.Add("ChatHistoryTimeout");
settings.Add("Provider"); settings.Add("Provider");
} }
public int GetChatHistoryTimeout()
{
return ReadSettingAsInt("ChatHistoryTimeout", 15);
}
public string GetProvider() public string GetProvider()
{ {
return ReadSettingAsString("Provider", "openai"); return ReadSettingAsString("Provider", "openai");
@ -59,7 +65,7 @@ namespace SecondBotEvents.Config
} }
public bool GetEnabled() public bool GetEnabled()
{ {
return ReadSettingAsBool("Enabled"); return ReadSettingAsBool("Enabled", false);
} }
public string GetApiKey() public string GetApiKey()
{ {

View file

@ -54,7 +54,7 @@ namespace SecondBotEvents.Config
public bool GetEnableMasterControls() public bool GetEnableMasterControls()
{ {
return ReadSettingAsBool("EnableMasterControls", false); return ReadSettingAsBool("EnableMasterControls", true);
} }
@ -65,7 +65,7 @@ namespace SecondBotEvents.Config
public bool GetAllowIMcontrol() public bool GetAllowIMcontrol()
{ {
return ReadSettingAsBool("AllowIMcontrol", false); return ReadSettingAsBool("AllowIMcontrol", true);
} }
public string GetSharedSecret() public string GetSharedSecret()

View file

@ -11,18 +11,12 @@ namespace SecondBotEvents.Config
{ {
filename = "http"; filename = "http";
settings.Add("Enabled"); settings.Add("Enabled");
settings.Add("Port");
settings.Add("HideStatusOutput"); settings.Add("HideStatusOutput");
} }
public int GetPort()
{
return ReadSettingAsInt("Port", 80);
}
public bool GetEnabled() public bool GetEnabled()
{ {
return ReadSettingAsBool("Enabled", false); return ReadSettingAsBool("Enabled", true);
} }
} }

View file

@ -48,7 +48,7 @@ namespace SecondBotEvents.Config
public bool GetAcceptTeleports() public bool GetAcceptTeleports()
{ {
return ReadSettingAsBool("AcceptTeleports", false); return ReadSettingAsBool("AcceptTeleports", true);
} }
public bool GetAcceptGroupInvites() public bool GetAcceptGroupInvites()
@ -73,7 +73,7 @@ namespace SecondBotEvents.Config
public bool GetEnableJsonOutputEvents() public bool GetEnableJsonOutputEvents()
{ {
return ReadSettingAsBool("EnableJsonOutputEvents", true); return ReadSettingAsBool("EnableJsonOutputEvents", false);
} }
} }

View file

@ -208,7 +208,7 @@ namespace SecondBotEvents.Services
foreach (KeyValuePair<UUID, long> entry in ChatHistoryLastAccessed) foreach (KeyValuePair<UUID, long> entry in ChatHistoryLastAccessed)
{ {
dif = now - entry.Value; dif = now - entry.Value;
if(dif > (7*60)) if(dif > (myConfig.GetChatHistoryTimeout()*60))
{ {
needcleaning.Add(entry.Key); needcleaning.Add(entry.Key);
} }