Chatting with Perplexity works now

This commit is contained in:
Peer Schütt 2025-08-29 19:14:01 +02:00 committed by Thorsten Sommer
parent c0ba27d509
commit 6dea63b7a2
2 changed files with 5 additions and 2 deletions

View File

@ -130,6 +130,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
{ {
LLMProviders.FIREWORKS => new Model(this.dataManuallyModel, null), LLMProviders.FIREWORKS => new Model(this.dataManuallyModel, null),
LLMProviders.HUGGINGFACE => new Model(this.dataManuallyModel, null), LLMProviders.HUGGINGFACE => new Model(this.dataManuallyModel, null),
LLMProviders.PERPLEXITY => new Model(this.dataManuallyModel, null),
_ => this.DataModel _ => this.DataModel
}, },
IsSelfHosted = this.DataLLMProvider is LLMProviders.SELF_HOSTED, IsSelfHosted = this.DataLLMProvider is LLMProviders.SELF_HOSTED,
@ -158,7 +159,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
this.dataEditingPreviousInstanceName = this.DataInstanceName.ToLowerInvariant(); this.dataEditingPreviousInstanceName = this.DataInstanceName.ToLowerInvariant();
// When using Fireworks or Hugging Face, we must copy the model name: // When using Fireworks or Hugging Face, we must copy the model name:
if (this.DataLLMProvider is LLMProviders.FIREWORKS or LLMProviders.HUGGINGFACE) if (this.DataLLMProvider.IsLLMModelProvidedManually())
this.dataManuallyModel = this.DataModel.Id; this.dataManuallyModel = this.DataModel.Id;
// //
@ -241,7 +242,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
private string? ValidateManuallyModel(string manuallyModel) private string? ValidateManuallyModel(string manuallyModel)
{ {
if ((this.DataLLMProvider is LLMProviders.FIREWORKS or LLMProviders.HUGGINGFACE) && string.IsNullOrWhiteSpace(manuallyModel)) if (this.DataLLMProvider.IsLLMModelProvidedManually() && string.IsNullOrWhiteSpace(manuallyModel))
return T("Please enter a model name."); return T("Please enter a model name.");
return null; return null;

View File

@ -250,6 +250,7 @@ public static class LLMProvidersExtensions
{ {
LLMProviders.FIREWORKS => "https://fireworks.ai/models?show=Serverless", LLMProviders.FIREWORKS => "https://fireworks.ai/models?show=Serverless",
LLMProviders.HUGGINGFACE => $"https://huggingface.co/models?inference_provider={inferenceProvider.EndpointsId()}", LLMProviders.HUGGINGFACE => $"https://huggingface.co/models?inference_provider={inferenceProvider.EndpointsId()}",
LLMProviders.PERPLEXITY => "https://docs.perplexity.ai/api-reference/chat-completions-post#body-model",
_ => string.Empty, _ => string.Empty,
}; };
@ -257,6 +258,7 @@ public static class LLMProvidersExtensions
{ {
LLMProviders.FIREWORKS => true, LLMProviders.FIREWORKS => true,
LLMProviders.HUGGINGFACE => true, LLMProviders.HUGGINGFACE => true,
LLMProviders.PERPLEXITY => true,
_ => false, _ => false,
}; };