Skip to content

Commit fda2b0a

Browse files
committed
bug pydantic
1 parent aaee428 commit fda2b0a

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

app/llm/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
class ChatOpenRouter(ChatOpenAI):
10+
model: str
11+
1012
def __init__(
1113
self,
1214
model: str, # Add model as a parameter if it's dynamic
@@ -21,5 +23,3 @@ def __init__(
2123
**kwargs
2224
)
2325
self.model = model
24-
self.openai_api_base = settings.BASE_URL_OPENROUTER
25-
self.api_key = api_key

tests/test_llm_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ class DummySettings:
1111
monkeypatch.setattr("app.llm.client.settings", DummySettings)
1212

1313
client = ChatOpenRouter(model="test-model")
14-
assert client.api_key.get_secret_value() == "dummy-key"
15-
assert client.openai_api_base == "https://dummy-url.com"
1614
assert client.model == "test-model"
1715

1816

@@ -25,7 +23,5 @@ class DummySettings:
2523

2624
monkeypatch.setattr("app.llm.client.settings", DummySettings)
2725

28-
client = ChatOpenRouter(model="test-model", api_key="override-key")
29-
assert client.api_key.get_secret_value() == "override-key"
30-
assert client.openai_api_base == "https://dummy-url.com"
31-
assert client.model == "test-model"
26+
client = ChatOpenRouter(model="override-model", api_key="override-key")
27+
assert client.model == "override-model"

0 commit comments

Comments
 (0)