create_app (_app.py)

agentscope · ai, flask-app, app-factory, secret-key, ui

Factory function that builds and configures a Flask app for AgentScope, including secret key generation.

# -*- coding: utf-8 -*-
"""AgentScope app factory."""
import secrets
from typing import Type, TYPE_CHECKING, Any

from ._lifespan import lifespan
from .access import DenyAllResourceAccessPolicy, ResourceAccessPolicyBase
from .hub import HubBase, HubError, MCPHubBase, SkillHubBase
from .rag.blob_store import BlobStoreBase, LocalBlobStore
from .rag.knowledge_base_manager import KnowledgeBaseManagerBase
from .workspace_manager import WorkspaceManagerBase
from ._router import (
    agent_router,
    channel_router,
    chat_router,
    credential_router,
    health_router,
    hub_router,
    knowledge_base_router,
    embedding_model_router,
    mcp_router,
    model_router,
    tts_model_router,
    schedule_router,
    session_router,
    skill_router,
    workspace_router,
)
from ._types i

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key