| 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # This source code is licensed under the terms described in the LICENSE file in |
| 5 | # the root directory of this source tree. |
| 6 | |
| 7 | from pydantic import BaseModel, Field |
| 8 | |
| 9 | from llama_models.schema_utils import json_schema_type |
| 10 | |
| 11 | from llama_stack.distribution.request_headers import annotate_header |
| 12 | |
| 13 | |
| 14 | class TogetherHeaderExtractor(BaseModel): |
| 15 | api_key: annotate_header( |
| 16 | "X-LlamaStack-Together-ApiKey", str, "The API Key for the request" |
| 17 | ) |
| 18 | |
| 19 | |
| 20 | @json_schema_type |
| 21 | class TogetherImplConfig(BaseModel): |
| 22 | url: str = Field( |
| 23 | default="https://api.together.xyz/v1", |
| 24 | description="The URL for the Together AI server", |
| 25 | ) |
| 26 | api_key: str = Field( |
| 27 | default="", |
| 28 | description="The Together AI API Key", |
| 29 | ) |