mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-26 09:18:53 +00:00
add export openAPI to config
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from typing import List, Literal, Optional, Union
|
||||
from pathlib import Path
|
||||
|
||||
CACHE_SIZES = Literal["FP16", "Q8", "Q6", "Q4"]
|
||||
|
||||
@@ -11,6 +12,22 @@ class ConfigOverrideConfig(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
class UtilityActions(BaseModel):
|
||||
export_config: Optional[str] = Field(
|
||||
None, description="generate a template config file"
|
||||
)
|
||||
config_export_path: Optional[Path] = Field(
|
||||
"config_sample.yml", description="path to export configuration file to"
|
||||
)
|
||||
|
||||
export_openapi: Optional[bool] = Field(
|
||||
False, description="export openapi schema files"
|
||||
)
|
||||
openapi_export_path: Optional[Path] = Field(
|
||||
"openapi.json", description="path to export openapi schema to"
|
||||
)
|
||||
|
||||
|
||||
class NetworkConfig(BaseModel):
|
||||
host: Optional[str] = Field("127.0.0.1", description=("The IP to host on"))
|
||||
port: Optional[int] = Field(5000, description=("The port to host on"))
|
||||
@@ -308,6 +325,7 @@ class TabbyConfigModel(BaseModel):
|
||||
embeddings: EmbeddingsConfig = Field(
|
||||
default_factory=EmbeddingsConfig.model_construct
|
||||
)
|
||||
actions: UtilityActions = Field(default_factory=UtilityActions.model_construct)
|
||||
|
||||
model_config = ConfigDict(validate_assignment=True, protected_namespaces=())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user