mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-05 23:49:40 +00:00
39 improve hostname handling (#42)
This commit is contained in:
1 parent
5250e5d2fb
commit
4f5815272a
5 files changed
+36
-13
No files matched your search
@@ -29,11 +29,11 @@
|
||||
<MudTd>
|
||||
@if (context.UsedProvider is not Providers.SELF_HOSTED)
|
||||
{
|
||||
@context.Model
|
||||
@this.GetProviderModelName(context)
|
||||
}
|
||||
else if (context.UsedProvider is Providers.SELF_HOSTED && context.Host is not Host.LLAMACPP)
|
||||
{
|
||||
@context.Model
|
||||
@this.GetProviderModelName(context)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -111,5 +111,12 @@ public partial class Settings : ComponentBase
|
||||
_ => string.Empty,
|
||||
};
|
||||
|
||||
private string GetProviderModelName(AIStudio.Settings.Provider provider)
|
||||
{
|
||||
const int MAX_LENGTH = 36;
|
||||
var modelName = provider.Model.ToString();
|
||||
return modelName.Length > MAX_LENGTH ? "[...] " + modelName[^Math.Min(MAX_LENGTH, modelName.Length)..] : modelName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user