Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DeepSeek as a Custom Provider #93

Open
brunocroh opened this issue Jan 28, 2025 · 6 comments
Open

Add DeepSeek as a Custom Provider #93

brunocroh opened this issue Jan 28, 2025 · 6 comments

Comments

@brunocroh
Copy link

I would like to know if it makes sense to add DeepSeek as one of parrot.nvim default providers.

If it makes sense for the project, let me know, I'm interested in contributing to the project and I think it could be a good first issue.

DeepSeek docs

https://api-docs.deepseek.com/api/deepseek-api

@frankroeder
Copy link
Owner

Hi @brunocroh,

Sure, go ahead and add a new provider. If possible, you can "inherit" from another provider (e.g. xAI is doing that from the OpenAI provider).

@brunocroh
Copy link
Author

Awesome, thank you, let me do that

@brunocroh
Copy link
Author

It's taking longer than expected because the DeepSeek API platform has been down since yesterday.
Waiting for it to be online to integrate

https://platform.deepseek.com/

Image

@naddeoa
Copy link

naddeoa commented Jan 29, 2025

What's the right way to address the visible thought reasoning? The model works well but you can't use it by default for inline code edits because it will end up inserting the reasoning chain as well. Does this just need custom logic to parse out the tags from the llm output?

@frankroeder
Copy link
Owner

@naddeoa I guess this is even harder to do for a streaming response. I might need to implement something like a callback functionality where users can define some routines after the response is completed, so one could easily write a Vim command to delete that <think></think> block.

@frankroeder
Copy link
Owner

What's the right way to address the visible thought reasoning? The model works well but you can't use it by default for inline code edits because it will end up inserting the reasoning chain as well. Does this just need custom logic to parse out the tags from the llm output?

@naddeoa
It is possible to invoke commands when the PrtDone event is triggered the following way:

local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd

local thinking_group = augroup("remove thinking tags", { clear = true })
autocmd({ "User" }, {
  pattern = { "PrtDone" },
  callback = function()
    vim.api.nvim_command [[%s/<think>\_.\{-}<\/think>//]]
  end,
  group = thinking_group,
  desc = "Delete text enclosed by <think> and </think> on custom 'PrtDone' event.",
})

This will delete the reasoning block encapsulated in the mentioned tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants