Full-Stack-AI-Meme-Generator icon indicating copy to clipboard operation
Full-Stack-AI-Meme-Generator copied to clipboard

Different API base support

Open Lachine1 opened this issue 2 years ago • 8 comments

Lachine1 avatar Jul 20 '23 08:07 Lachine1

for openai btw

Lachine1 avatar Jul 20 '23 08:07 Lachine1

I don't undestand

ThioJoe avatar Jul 21 '23 01:07 ThioJoe

I don't undestand

import openai
openai.api_base = "https://example.api.com/"

Lachine1 avatar Jul 21 '23 07:07 Lachine1

I see, I'll look into adding that

ThioJoe avatar Jul 21 '23 17:07 ThioJoe

agreed, there are openai alternatives which use the same url structure as openai so there could be a commented out setting in the settings.ini file to enable a custom base url.

# Allows use of custom base urls.
# BaseURL = https://api.openai.com/v1

or something like that

NavaShield avatar Jul 21 '23 17:07 NavaShield

Just so you know though, the script uses the OpenAI python package, not URL endpoints directly. So might not be possible in the current state if the goal is to use a different service altogether.

Should work if just changing the url base to use an api gateway or something.

ThioJoe avatar Jul 21 '23 19:07 ThioJoe

you should use dall-e for image gen too

Lachine1 avatar Jul 25 '23 15:07 Lachine1

Just so you know though, the script uses the OpenAI python package, not URL endpoints directly. So might not be possible in the current state if the goal is to use a different service altogether.

import openai

openai.api_key = 'catto_key_************************'
openai.api_base = 'https://api.cattto.repl.co/v1'

(code stolen from a chatgpt alternative but yeah)

NavaShield avatar Jul 25 '23 17:07 NavaShield