Nutanix AI distribution

This commit is contained in:
Jinan Zhou 2024-11-21 23:45:48 +00:00
parent f2ac4e2a94
commit cb82b1ee9e
10 changed files with 237 additions and 14 deletions

View file

@ -1,9 +1,11 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# Copyright (c) Nutanix, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from typing import Any, Dict, Optional
from llama_models.schema_utils import json_schema_type
from pydantic import BaseModel, Field
@ -11,10 +13,17 @@ from pydantic import BaseModel, Field
@json_schema_type
class NutanixImplConfig(BaseModel):
url: str = Field(
default=None,
description="The URL of the Nutanix AI endpoint",
default="https://ai.nutanix.com/api/v1",
description="The URL of the Nutanix AI Endpoint",
)
api_token: str = Field(
api_key: Optional[str] = Field(
default=None,
description="The API token of the Nutanix AI endpoint",
description="The API key to the Nutanix AI Endpoint",
)
@classmethod
def sample_run_config(cls) -> Dict[str, Any]:
return {
"url": "https://ai.nutanix.com/api/v1",
"api_key": "${env.NUTANIX_API_KEY}",
}