docs: macOS tiktoken core install (#7)

also fix azure default api_version
This commit is contained in:
Wey Gu 2024-08-15 16:00:18 +08:00 committed by GitHub
parent 0da115bf7f
commit 2951217a68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 5 deletions

3
.gitignore vendored
View File

@ -42,3 +42,6 @@ temp/
# If you have any personal configuration files, you should ignore them too # If you have any personal configuration files, you should ignore them too
config.personal.lua config.personal.lua
# Avante chat history
.avante_chat_history

View File

@ -17,9 +17,18 @@ https://github.com/user-attachments/assets/510e6270-b6cf-459d-9a2f-15b397d1fe53
1. Install `tiktoken_core` (Optional): 1. Install `tiktoken_core` (Optional):
- tiktoken_core: `sudo luarocks install --lua-version 5.1 tiktoken_core`. Alternatively, download a pre-built binary from [lua-tiktoken releases](https://github.com/gptlang/lua-tiktoken/releases) - tiktoken_core: `sudo luarocks install --lua-version 5.1 tiktoken_core`. Alternatively, download a pre-built binary from [lua-tiktoken releases](https://github.com/gptlang/lua-tiktoken/releases)
- You can check your Lua PATH in Neovim by doing `:lua print(package.cpath)`. Save the binary as `tiktoken_core.so` in any of the given paths. - You can check your Lua PATH in Neovim by doing `:lua print(package.cpath)`. Save the binary as `tiktoken_core.so` in any of the given paths.
> For Arch Linux user, you can install [`luajit-tiktoken-bin`](https://aur.archlinux.org/packages/luajit-tiktoken-bin) or [`lua51-tiktoken-bin`](https://aur.archlinux.org/packages/lua51-tiktoken-bin) from aur! > For Arch Linux user, you can install [`luajit-tiktoken-bin`](https://aur.archlinux.org/packages/luajit-tiktoken-bin) or [`lua51-tiktoken-bin`](https://aur.archlinux.org/packages/lua51-tiktoken-bin) from aur!
>
> For macOS users:
> 1. Install `luarocks` using Homebrew: `brew install luarocks`
> 2. Install `tiktoken_core`: `luarocks install --lua-version 5.1 tiktoken_core`
> 3. Copy the installed `tiktoken_core.so` to your Homebrew Lua path:
> `cp ~/.luarocks/lib/lua/5.1/tiktoken_core.so $(brew --prefix)/lib/lua/5.1/`
>
> This ensures `tiktoken_core` is properly installed and accessible in your Neovim environment.
2. Install `avante.nvim` using [lazy.nvim](https://github.com/folke/lazy.nvim): 2. Install `avante.nvim` using [lazy.nvim](https://github.com/folke/lazy.nvim):
@ -58,7 +67,7 @@ https://github.com/user-attachments/assets/510e6270-b6cf-459d-9a2f-15b397d1fe53
azure = { azure = {
endpoint = "", -- Example: "https://<your-resource-name>.openai.azure.com" endpoint = "", -- Example: "https://<your-resource-name>.openai.azure.com"
deployment = "", -- Azure deployment name (e.g., "gpt-4o", "my-gpt-4o-deployment") deployment = "", -- Azure deployment name (e.g., "gpt-4o", "my-gpt-4o-deployment")
api_version = "2024-05-13", api_version = "2024-06-01",
temperature = 0, temperature = 0,
max_tokens = 4096, max_tokens = 4096,
}, },

View File

@ -754,7 +754,7 @@ M.config = {
azure = { azure = {
endpoint = "", -- example: "https://<your-resource-name>.openai.azure.com" endpoint = "", -- example: "https://<your-resource-name>.openai.azure.com"
deployment = "", -- Azure deployment name (e.g., "gpt-4o", "my-gpt-4o-deployment") deployment = "", -- Azure deployment name (e.g., "gpt-4o", "my-gpt-4o-deployment")
api_version = "2024-05-13", api_version = "2024-06-01",
temperature = 0, temperature = 0,
max_tokens = 4096, max_tokens = 4096,
}, },