-
Notifications
You must be signed in to change notification settings - Fork 37
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
How to set the api url? #48
Comments
Hi @guoliangzeng , I don't get the question. |
Receiving your reply is truly delightful, and I appreciate you taking the time.
Yes, you understand correctly. In my country, it is not possible to directly purchase openai's API service, so I use a third-party service to access the openai API.
Therefore, I need to set the corresponding API URL to the third-party's URL. Hence, I have to ask for your guidance on how to make this configuration in your GitHub project.
…--------------原始邮件--------------
发件人:"Juan C Rodriguez ***@***.***>;
发送时间:2023年11月2日(星期四) 晚上6:58
收件人:"jcrodriguez1989/chatgpt" ***@***.***>;
抄送:"曾国梁 ***@***.***>;"Mention ***@***.***>;
主题:Re: [jcrodriguez1989/chatgpt] How to set the api url? (Issue #48)
-----------------------------------
Hi @guoliangzeng , I don't get the question.
Instead of using https://api.openai.com/v1/chat/completions you need to use another URL?
If so, every endpoint works exactly the same?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Ok, sounds like we can workaround it. |
You are so nice,thanks a lot.
The similaer URL from the third-party is 'https://api.chatanywhere.com.cn'
…--------------原始邮件--------------
发件人:"Juan C Rodriguez ***@***.***>;
发送时间:2023年11月8日(星期三) 凌晨0:34
收件人:"jcrodriguez1989/chatgpt" ***@***.***>;
抄送:"曾国梁 ***@***.***>;"Mention ***@***.***>;
主题:Re: [jcrodriguez1989/chatgpt] How to set the api url? (Issue #48)
-----------------------------------
Ok, sounds like we can workaround it.
This is the current URL we are using in this package https://api.openai.com/v1/chat/completions. May I know which will be the similar URL that we should point to?
Or at least, let me know which part of https://api.openai.com/v1/chat/completions should be replaceable.
best,
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi @guoliangzeng , remotes::install_github("jcrodriguez1989/chatgpt@feature.jcr.switch_api_url")
Sys.setenv(OPENAI_API_URL = "https://api.chatanywhere.com.cn/v1")
# If this doesn't work, do `Sys.setenv(OPENAI_API_URL = "https://api.chatanywhere.com.cn")`
library("chatgpt")
cat(ask_chatgpt("What do you think about R language?")) Please, let me know if you get any errors. |
oh,when i set the url to 'https://api.chatanywhere.com.cn' , it's working。i can use it now~thank you so much!have every nice day~
…--------------原始邮件--------------
发件人:"Juan C Rodriguez ***@***.***>;
发送时间:2023年11月9日(星期四) 下午4:45
收件人:"jcrodriguez1989/chatgpt" ***@***.***>;
抄送:"曾国梁 ***@***.***>;"Mention ***@***.***>;
主题:Re: [jcrodriguez1989/chatgpt] How to set the api url? (Issue #48)
-----------------------------------
Hi @guoliangzeng ,
I created a branch that allows changing the OPENAI's API URL. Could you try doing this?
***@***.***_api_url") Sys.setenv(OPENAI_API_URL = "https://api.chatanywhere.com.cn/v1") # If this doesn't work, do `Sys.setenv(OPENAI_API_URL = "")` library("chatgpt") cat(ask_chatgpt("What do you think about R language?"))
Please, let me know if you get any errors.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Excuse me, if using a third-party intermediary service, how should I set up the API URL for chatgpt?
The text was updated successfully, but these errors were encountered: