alfredapp / openai-workflow

OpenAI integrations
BSD 3-Clause "New" or "Revised" License
65 stars 29 forks source link

Update chatgpt to support chatgpt_custom_model env variable #16

Closed iandol closed 7 months ago

iandol commented 7 months ago

A user can add a chatgpt_custom_model env variable and this will be passed to to the startstream function, so now both api and model can be customised for use with local and online alternatives to OpenAI

vitorgalvao commented 7 months ago

This is already in a local change. It can be made much simpler, only one line is needed:

const model = envVar("chatgpt_model_override") ? envVar("chatgpt_model_override") : envVar("gpt_model")

Please don’t change variable and argument names.

Try this version.

iandol commented 7 months ago

OK, I'll close this pull request (I don't code in javascript, hence my clunky code ;-)

iandol commented 7 months ago

OK, I'll close this pull request (I don't code in javascript, hence my clunky code ;-)

iandol commented 7 months ago

@vitorgalvao -- this is an error in your current test version right (line 200 of chatgpt)?

const apiEndpoint = envVar("dalle_api_endpoint") || "https://api.openai.com"
vitorgalvao commented 7 months ago

Yes, that has been fixed and answered in the forum post.