Skip to content

Commit 51a8c69

Browse files
committed
CHORE: change default base URL of ArgoConfig to OpenAI-compatible endpoint and deprecate user
1 parent 59ae54f commit 51a8c69

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

docs/llm-config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Available config classes
3737
- ``model``
3838
- ``base_url``
3939
- ``api_key``
40-
- ``user``
40+
- ``user`` (deprecated; accepted temporarily and ignored)
4141

4242
How the config is used
4343
----------------------

packages/eaa-core/src/eaa_core/api/llm_config.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dataclasses import dataclass
2+
import warnings
23

34
from eaa_core.api.base import BaseConfig
45

@@ -30,10 +31,19 @@ class AskSageConfig(LLMConfig):
3031

3132

3233
@dataclass
33-
class ArgoConfig(LLMConfig):
34+
class ArgoConfig(OpenAIConfig):
3435
"""Configuration for Argo endpoints."""
3536

36-
model: str = None
37-
base_url: str = "https://apps-dev.inside.anl.gov/argoapi/api/v1/resource/"
37+
base_url: str = "https://apps-dev.inside.anl.gov/argoapi/v1"
3838
api_key: str = "ARGO_USER"
39-
user: str = None
39+
user: str | None = None
40+
41+
def __post_init__(self) -> None:
42+
"""Warn when the deprecated compatibility field is still used."""
43+
if self.user is not None:
44+
warnings.warn(
45+
"`ArgoConfig.user` is deprecated and ignored. "
46+
"Configure authentication through `api_key` instead.",
47+
DeprecationWarning,
48+
stacklevel=2,
49+
)

packages/eaa-core/src/eaa_core/llm/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from langchain_core.messages.utils import convert_to_messages
55
from langchain_openai import ChatOpenAI
66

7-
from eaa_core.api.llm_config import ArgoConfig, AskSageConfig, LLMConfig, OpenAIConfig
7+
from eaa_core.api.llm_config import AskSageConfig, LLMConfig, OpenAIConfig
88
from eaa_core.message_proc import ai_message_to_openai_dict
99

1010

1111
def build_chat_model(llm_config: LLMConfig) -> ChatOpenAI:
1212
"""Build a LangChain chat model from an EAA LLM config."""
13-
if isinstance(llm_config, (OpenAIConfig, ArgoConfig)):
13+
if isinstance(llm_config, OpenAIConfig):
1414
return ChatOpenAI(
1515
model=llm_config.model,
1616
base_url=llm_config.base_url,

0 commit comments

Comments
 (0)