MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / create_codex2api_service

Function create_codex2api_service

src/database/crud.py:819–838  ·  view source on GitHub ↗

创建 Codex2API 服务配置

(
    db: Session,
    name: str,
    api_url: str,
    admin_key: str,
    enabled: bool = True,
    priority: int = 0,
)

Source from the content-addressed store, hash-verified

817# ============================================================================
818
819def create_codex2api_service(
820 db: Session,
821 name: str,
822 api_url: str,
823 admin_key: str,
824 enabled: bool = True,
825 priority: int = 0,
826) -> Codex2ApiService:
827 """创建 Codex2API 服务配置"""
828 svc = Codex2ApiService(
829 name=name,
830 api_url=api_url,
831 admin_key=admin_key,
832 enabled=enabled,
833 priority=priority,
834 )
835 db.add(svc)
836 db.commit()
837 db.refresh(svc)
838 return svc
839
840
841def get_codex2api_service_by_id(db: Session, service_id: int) -> Optional[Codex2ApiService]:

Callers

nothing calls this directly

Calls 1

Codex2ApiServiceClass · 0.85

Tested by

no test coverage detected