from databricks.sdk import WorkspaceClient
from databricks.sdk.service.serving import (
EndpointCoreConfigInput,
ServedEntityInput,
AutoCaptureConfigInput
)
w = WorkspaceClient()
# 엔드포인트 생성 (세부 설정 포함)
endpoint = w.serving_endpoints.create(
name="customer-support-agent",
config=EndpointCoreConfigInput(
served_entities=[
ServedEntityInput(
entity_name="catalog.schema.customer_support_agent",
entity_version="3",
workload_size="Small", # Small, Medium, Large
scale_to_zero_enabled=True, # 비활성 시 0으로 축소
environment_vars={
"VECTOR_SEARCH_ENDPOINT": {"type": "plain", "value": "vs-endpoint"},
"API_KEY": {"type": "secret", "key": "scope/key"} # 시크릿 참조
}
)
],
auto_capture_config=AutoCaptureConfigInput(
enabled=True,
catalog_name="catalog",
schema_name="schema",
table_name_prefix="agent_logs"
)
)
)