diff --git a/RequestPerplexity.go b/RequestPerplexity.go index e902548..2c7332b 100644 --- a/RequestPerplexity.go +++ b/RequestPerplexity.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "net/http" + "strings" "github.com/edgedb/edgedb-go" "github.com/gofiber/fiber/v2" @@ -178,6 +179,13 @@ func RequestPerplexity(c *fiber.Ctx, model string, messages []Message, temperatu var inputCost float32 = float32(chatCompletionResponse.Usage.PromptTokens) * usedModelInfo.InputPrice var outputCost float32 = float32(chatCompletionResponse.Usage.CompletionTokens) * usedModelInfo.OutputPrice + + // If online model end with -online add a small cost + if strings.HasSuffix(model, "-online") { + inputCost += 0.005 + outputCost += 0.005 + } + addUsage(c, inputCost, outputCost, chatCompletionResponse.Usage.PromptTokens, chatCompletionResponse.Usage.CompletionTokens, model) return chatCompletionResponse, nil diff --git a/static/icons/perplexity.png b/static/icons/perplexity.png index f8de7fd..cfa8ed6 100644 Binary files a/static/icons/perplexity.png and b/static/icons/perplexity.png differ diff --git a/views/partials/chat-input.html b/views/partials/chat-input.html index fd61775..c1771a0 100644 --- a/views/partials/chat-input.html +++ b/views/partials/chat-input.html @@ -43,6 +43,9 @@ // Every 0.01s check if the text area have htmx-request class, if yes, add the class is-loading setInterval(function () { + if (textareaControl === null) { + return; + } if (textareaControl.classList.contains('htmx-request')) { textareaControl.classList.add('is-loading'); } else { diff --git a/views/partials/welcome-chat.html b/views/partials/welcome-chat.html index 05188eb..97c5f1f 100644 --- a/views/partials/welcome-chat.html +++ b/views/partials/welcome-chat.html @@ -1,11 +1,12 @@ -

JADE: The First Multi-Model Chatbot

-

The world of Large Language Models (LLMs) is vast and exciting, with each model boasting unique strengths and +

JADE: The First Multi-Model Chatbot

+

+

The world of Large Language Models (LLMs) is vast and exciting, with each model having unique strengths and weaknesses. However, this variety presents a challenge: using all available LLMs is practically impossible due to cost and complexity. Wouldn't it be incredible to have an easy way to experiment with different models, compare their responses, and even choose the best model for a specific task?

This is precisely why JADE was built. With a focus on simplicity, JADE eliminates unnecessary features like file or - image uploads, allowing you to seamlessly interact with a variety of LLMs. This streamlined approach unlocks the + image uploads, allowing you to interact with a variety of LLMs. This streamlined approach unlocks the potential to compare models, leverage their individual strengths, and even mitigate biases through multi-message conversations.

@@ -18,7 +19,7 @@
  • The selected response can be used as the basis for the next message across all models.
  • -

    For example, a response from GPT-4 can be used by Claude Haiku in the next interaction

    +

    For example, a response from GPT-4 Omni can be used by Claude Haiku in the next interaction.

    This approach offers several benefits. First, it ensures you always have access to the best possible response by leveraging the strengths of different models. Second, it provides a more comprehensive understanding of a topic by @@ -77,10 +78,200 @@ -

    + + +
  • +

    All providers.

    +