diff --git a/src/llm_postor/demo_gui.py b/src/llm_postor/demo_gui.py index bea790d..92532d8 100644 --- a/src/llm_postor/demo_gui.py +++ b/src/llm_postor/demo_gui.py @@ -15,7 +15,7 @@ def main(): gui_handler = GUIHandler() game_engine = GameEngine() - # model_name = "gpt-4o-mini" # Or any other suitable model name + # model_name = "openai/gpt-4o-mini" # Or any other suitable model name model_name = "google/gemini-flash-1.5-exp" # Or any other suitable model name player_names = ["Mateusz", "Andrii", "Vasyl", "Marcin", "Dariusz", "Iwo"] diff --git a/src/llm_postor/game/consts.py b/src/llm_postor/game/consts.py index 1b9df37..6465e71 100644 --- a/src/llm_postor/game/consts.py +++ b/src/llm_postor/game/consts.py @@ -40,17 +40,17 @@ """ million = 1000000 TOKEN_COSTS = { - "gpt-4o": { + "openai/gpt-4o": { "input_tokens": 2.5 / million, "cache_read": 1.25 / million, "output_tokens": 10 / million, }, - "gpt-4o-mini": { + "openai/gpt-4o-mini": { "input_tokens": 0.15 / million, "cache_read": 0.075 / million, "output_tokens": 0.6 / million, }, - "gemini-1.5-flash": { + "google/gemini-1.5-flash-exp": { "input_tokens": 0, "cache_read": 0, "output_tokens": 0, diff --git a/src/llm_postor/game/players/ai.py b/src/llm_postor/game/players/ai.py index fefc50d..0e33135 100644 --- a/src/llm_postor/game/players/ai.py +++ b/src/llm_postor/game/players/ai.py @@ -1,3 +1,4 @@ +from os import getenv from typing import List from langchain_openai import ChatOpenAI from langchain_google_genai import ChatGoogleGenerativeAI @@ -18,7 +19,7 @@ def __init__(self, **data): def init_agents(self): llm = ChatOpenAI( base_url="https://openrouter.ai/api/v1", - api_key="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", + api_key=getenv("OPENROUTER_API_KEY"), model=self.llm_model_name, temperature=0.1 )