Skip to content

Commit

Permalink
Merge branch 'main' into bagatur/start_v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mattf committed Sep 17, 2024
2 parents 9044a6a + d14850d commit 8323298
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 289 deletions.
12 changes: 6 additions & 6 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ def _validate_base_url(cls, v: str) -> str:
@model_validator(mode="before")
@classmethod
def _preprocess_args(cls, values: Dict[str, Any]) -> Any:
values["api_key"] = (
values.get(_API_KEY_VAR.lower())
or values.get("api_key")
or os.getenv(_API_KEY_VAR.upper())
or None
)
# if api_key is not provided or None,
# try to get it from the environment
# we can't use Field(default_factory=...)
# because construction may happen with api_key=None
if values.get("api_key") is None:
values["api_key"] = os.getenv(cls._api_key_var)

## Making sure /v1 in added to the url, followed by infer_path
if "base_url" in values:
Expand Down
10 changes: 10 additions & 0 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/_statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ def validate_client(cls, client: str, values: dict) -> str:
model_type="chat",
client="ChatNVIDIA",
),
"abacusai/dracarys-llama-3.1-70b-instruct": Model(
id="abacusai/dracarys-llama-3.1-70b-instruct",
model_type="chat",
client="ChatNVIDIA",
),
}

QA_MODEL_TABLE = {
Expand Down Expand Up @@ -521,6 +526,11 @@ def validate_client(cls, client: str, values: dict) -> str:
model_type="embedding",
client="NVIDIAEmbeddings",
),
"nvidia/embed-qa-4": Model(
id="nvidia/embed-qa-4",
model_type="embedding",
client="NVIDIAEmbeddings",
),
}

RANKING_MODEL_TABLE = {
Expand Down
283 changes: 0 additions & 283 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/tools.py

This file was deleted.

0 comments on commit 8323298

Please sign in to comment.