-
Notifications
You must be signed in to change notification settings - Fork 39
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
[Suggestion] Adding deepseek and openrouter support #212
Comments
@chendakeng could you please show me what you've tried and the errors you received? That would make it easier for me to look into. I've made deep seek a separate issue at #242 |
Thanks for replying to this issue about open router. I tried the code below. Since the open router api uses openai compatible format, I used "chat_openai" function, but it did not work. The chat_openai example:
Then I try to use the httr2 to directly link to open router API. The httr2 chat example:
I also test the sentiment example using httr2 and open router API in case you need to see the json response format.
|
I suspect the difference is in how streaming is handled. Does |
Thanks for providing possible solutions! Yes, if I specify 'echo = FALSE' in 'chat_openai()`, it works! And both the chat and extract_data work perfectly for the openai series models in openrouter! That's nice! But when I specified other models available on openrouter (the beauty of platforms like openrouter is that you can use 1 API to test multiple models with the same task to compare their performance), it did not work well. The results are not consistent, some work for I am giving you some more cases: The successful one,
A half-successful one
The other half-successful one,
Thanks again for your time on this issue. |
This is a fascinating package! It's so TIDY, I like it a lot.
I am trying to use both deepseek (https://api-docs.deepseek.com/) and openrouter (https://openrouter.ai/docs/quick-start) with the chat_openai and extract_data functions.
Although they all use openai compatible API, but it seems like the response format is different from what the elmer package would expect. I try to revise the package directly to handle the response properly, but my attempts failed (all errors remained mine, I am a poor coder...)
I hope the developer can consider adding these 2 platforms. Deepseek is a very powerful open source model with a good price/performance ratio, while openrouter allows us to use a single apikey to access a variety of models, which is much more efficient in navigating between different models.
Cheers!
Devin
The text was updated successfully, but these errors were encountered: