-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support openrouter.ai #43
Labels
bug
Something isn't working
Comments
Hey, thank you for the kind words 🙂 That error is a bit weird, I'll look into it when I get some time! |
For other seekers. It was invalid url in config. There is worked example
[openai]
api_key = "<key>"
default_model = "deepseek/deepseek-chat:free"
url = "https://openrouter.ai/api/v1/chat/completions"
[rust2]
api = "openai"
# char_limit = 50000
[[rust2.messages]]
role = "system"
content = """\
You are an expert programmer and a shell master. You value code efficiency and clarity above all things. \
What you write will be piped in and out of cli programs so you do not explain anything unless explicitly asked to. \
Never write ``` around your answer, never write comments, provide only the result of the task you are given. Preserve input formatting.\
"""
[[rust2.messages]]
role = "user"
# the following placeholder string #[<input>] will be replaced by the input
# each message seeks it and replaces it
content ='''Write rust code by following description. Provide only the code without any comments or explanations or markdown code wrapper.
#[<input>]
'''
[rust2]
api = "openai"
# char_limit = 50000
[[rust2.messages]]
role = "system"
content = """\
You are an expert programmer and a shell master. You value code efficiency and clarity above all things. \
What you write will be piped in and out of cli programs so you do not explain anything unless explicitly asked to. \
Never write ``` around your answer, never write comments, provide only the result of the task you are given. Preserve input formatting.\
"""
[[rust2.messages]]
role = "user"
# the following placeholder string #[<input>] will be replaced by the input
# each message seeks it and replaces it
content ='''Write rust code by following description. Provide only the code without any comments or explanations or markdown code wrapper.
#[<input>]
'''
$ sc rust2 "Give me factorial function using for loop" fn factorial(n: u64) -> u64 {
let mut result = 1;
for i in 1..=n {
result *= i;
}
result
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, and thanks for a fantastic product! Your POSIX approach, which enables Vim and other cli programs, speaks a lot!
Please consider adding support for the https://openrouter.ai/
I attempted to reuse Openai API
but ended up with
The text was updated successfully, but these errors were encountered: