Add support for ollama (#34)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-07-16 10:28:13 +02:00
1 parent 179f350af5
commit 063fd0fcfa
19 files changed
+271 -75

No files matched your search

+12 -2
View File
@@ -1,5 +1,7 @@
using AIStudio.Provider;
using Host = AIStudio.Provider.SelfHosted.Host;
namespace AIStudio.Settings;
/// <summary>
@@ -12,7 +14,15 @@ namespace AIStudio.Settings;
/// <param name="IsSelfHosted">Whether the provider is self-hosted.</param>
/// <param name="Hostname">The hostname of the provider. Useful for self-hosted providers.</param>
/// <param name="Model">The LLM model to use for chat.</param>
public readonly record struct Provider(uint Num, string Id, string InstanceName, Providers UsedProvider, Model Model, bool IsSelfHosted = false, string Hostname = "http://localhost:1234")
public readonly record struct Provider(
uint Num,
string Id,
string InstanceName,
Providers UsedProvider,
Model Model,
bool IsSelfHosted = false,
string Hostname = "http://localhost:1234",
Host Host = Host.NONE)
{
#region Overrides of ValueType
@@ -24,7 +34,7 @@ public readonly record struct Provider(uint Num, string Id, string InstanceName,
public override string ToString()
{
if(this.IsSelfHosted)
return $"{this.InstanceName} ({this.UsedProvider.ToName()}, {this.Hostname}, {this.Model})";
return $"{this.InstanceName} ({this.UsedProvider.ToName()}, {this.Host}, {this.Hostname}, {this.Model})";
return $"{this.InstanceName} ({this.UsedProvider.ToName()}, {this.Model})";
}