Skip to content

Commit 0cccf7f

Browse files
committed
Revert "Add api_key field to"
This reverts commit 1fec637.
1 parent 1fec637 commit 0cccf7f

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

nemoguardrails/rails/llm/config.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ class Model(BaseModel):
101101
default=None,
102102
description="The name of the model. If not specified, it should be specified through the parameters attribute.",
103103
)
104-
api_key: Optional[str] = Field(
105-
default=None,
106-
description="The API Key to use in requests to this model",
107-
)
104+
108105
reasoning_config: Optional[ReasoningModelConfig] = Field(
109106
default_factory=ReasoningModelConfig,
110107
description="Configuration parameters for reasoning LLMs.",

tests/test_rails_llm_config.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,3 @@ def test_model_name_none_in_parameters():
123123
"""Test that None model_name in parameters fails validation."""
124124
with pytest.raises(ValueError, match="Model name must be specified"):
125125
Model(type="main", engine="openai", parameters={"model_name": None})
126-
127-
128-
def test_model_api_key_not_set():
129-
"""Create a `Model` pydantic model without APi Key field"""
130-
no_api_key_model = Model(type="main", engine="openai", model="gpt-4")
131-
assert no_api_key_model.api_key is None
132-
133-
134-
def test_model_api_key_set():
135-
"""Create a `Model` pydantic model without APi Key field"""
136-
api_key = "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"
137-
no_api_key_model = Model(
138-
type="main", engine="openai", model="gpt-4", api_key=api_key
139-
)
140-
assert no_api_key_model.api_key == api_key

0 commit comments

Comments
 (0)