CoderCookE / vim-chatgpt

Vim Plugin For ChatGPT
The Unlicense
230 stars 29 forks source link

Optimize window split & change code to adapt to latest openai package #35

Closed Duan-JM closed 6 months ago

Duan-JM commented 7 months ago

Tests

[x] Support on vim with openai api and azure openai api [x] Support on neovim with openai api and azure openai api

Modifications

  1. Break change to support latest openai package. The reason to do so is that latest openai-python is more readable and also support a lot of local LLMs, such as Mistral / GLM deployed by vllm
  2. Support Azure Openai API.
  3. Support custom window size.

Azure openai configure

let g:api_type = 'azure'
let g:chat_gpt_key = 'your_azure_chatgpt_api'
let g:azure_endpoint = 'your_azure_endpoint'
let g:azure_deployment = 'your_azure_deployment'
let g:azure_api_version = '2023-03-15-preview'

" custom split window size
let g:chat_gpt_split_direction = 'vertical'
let g:split_ratio=4

Openai configure

Same as original verision

Duan-JM commented 7 months ago

32

CoderCookE commented 6 months ago

Thanks for the PR, overall looks like it's a good direction. Couple comments to address, we'll also want to make sure to update the README to document the new configuration options.

Duan-JM commented 6 months ago

Thank you for your suggestions. I have made the modifications as suggested and updated the README.