Skip to content

Commit

Permalink
getenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Luncenok committed Oct 25, 2024
1 parent 715ab2a commit d4f107b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/llm_postor/demo_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
6 changes: 3 additions & 3 deletions src/llm_postor/game/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/llm_postor/game/players/ai.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from os import getenv
from typing import List
from langchain_openai import ChatOpenAI
from langchain_google_genai import ChatGoogleGenerativeAI
Expand All @@ -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
)
Expand Down

0 comments on commit d4f107b

Please sign in to comment.