fix: remove copilot provider (#318)

This commit is contained in:
yetone
2024-08-28 20:51:20 +08:00
committed by GitHub
parent b661269b5b
commit bfa203018e
10 changed files with 22 additions and 464 deletions

View File

@@ -1,6 +1,4 @@
--Taken from https://github.com/jackMort/ChatGPT.nvim/blob/main/lua/chatgpt/flows/chat/tokens.lua
local Tiktoken = require("avante.tiktoken")
---@class avante.utils.tokens
local Tokens = {}
@@ -13,9 +11,6 @@ local cost_per_token = {
---@param text string The text to calculate the number of tokens for.
---@return integer The number of tokens in the given text.
function Tokens.calculate_tokens(text)
if Tiktoken.available() then
return Tiktoken.count(text)
end
local tokens = 0
local current_token = ""
for char in text:gmatch(".") do