Add support for other backends, such as OpenRouter and olama

This aims to offer alternative OpenAI capable api's.
This offers people to experiment with running the application locally
This commit is contained in:
maxer137
2025-06-11 14:19:25 +02:00
parent a879868396
commit 99789f9cd1
6 changed files with 110 additions and 41 deletions

View File

@@ -703,10 +703,11 @@ def get_YFin_data(
def get_stock_news_openai(ticker, curr_date):
client = OpenAI()
config = get_config()
client = OpenAI(base_url=config["openai_backend"])
response = client.responses.create(
model="gpt-4.1-mini",
model=config["quick_think_llm"],
input=[
{
"role": "system",
@@ -737,10 +738,11 @@ def get_stock_news_openai(ticker, curr_date):
def get_global_news_openai(curr_date):
client = OpenAI()
config = get_config()
client = OpenAI(base_url=config["openai_backend"])
response = client.responses.create(
model="gpt-4.1-mini",
model=config["quick_think_llm"],
input=[
{
"role": "system",
@@ -771,10 +773,11 @@ def get_global_news_openai(curr_date):
def get_fundamentals_openai(ticker, curr_date):
client = OpenAI()
config = get_config()
client = OpenAI(base_url=config["openai_backend"])
response = client.responses.create(
model="gpt-4.1-mini",
model=config["quick_think_llm"],
input=[
{
"role": "system",