@@ -27,6 +27,13 @@ def _generate_response(prompt: str) -> str:
|
|||||||
api_key = config.app.get("moonshot_api_key")
|
api_key = config.app.get("moonshot_api_key")
|
||||||
model_name = config.app.get("moonshot_model_name")
|
model_name = config.app.get("moonshot_model_name")
|
||||||
base_url = "https://api.moonshot.cn/v1"
|
base_url = "https://api.moonshot.cn/v1"
|
||||||
|
elif llm_provider == "ollama":
|
||||||
|
# api_key = config.app.get("openai_api_key")
|
||||||
|
api_key = "ollama" # any string works but you are required to have one
|
||||||
|
model_name = config.app.get("ollama_model_name")
|
||||||
|
base_url = config.app.get("ollama_base_url", "")
|
||||||
|
if not base_url:
|
||||||
|
base_url = "http://localhost:11434/v1"
|
||||||
elif llm_provider == "openai":
|
elif llm_provider == "openai":
|
||||||
api_key = config.app.get("openai_api_key")
|
api_key = config.app.get("openai_api_key")
|
||||||
model_name = config.app.get("openai_model_name")
|
model_name = config.app.get("openai_model_name")
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
# gemini
|
# gemini
|
||||||
llm_provider="openai"
|
llm_provider="openai"
|
||||||
|
|
||||||
|
########## Ollama Settings
|
||||||
|
# No need to set it unless you want to use your own proxy
|
||||||
|
ollama_base_url = ""
|
||||||
|
# Check your available models at https://ollama.com/library
|
||||||
|
ollama_model_name = ""
|
||||||
|
|
||||||
########## OpenAI API Key
|
########## OpenAI API Key
|
||||||
# Get your API key at https://platform.openai.com/api-keys
|
# Get your API key at https://platform.openai.com/api-keys
|
||||||
openai_api_key = ""
|
openai_api_key = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user