recap.api
Submodules
recap.api.app
- class recap.api.app.ChatRequest(*, message: str, session_id: str | None = None)[source]
Bases:
BaseModel- message: str
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- session_id: str | None
- class recap.api.app.ChatResponse(*, session_id: str, response: str, history: list[dict])[source]
Bases:
BaseModel- history: list[dict]
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- response: str
- session_id: str
- class recap.api.app.RECAPApi(orchestrator: Orchestrator)[source]
Bases:
objectSCREApi - Simplified STPA Analysis Orchestrator.
Generates FastAPI app for interacting with the scre pipeline via the api.
recap.api.session
- class recap.api.session.InMemorySessionStore[source]
Bases:
objectA basic implementation using in memory dictionary for storing chat sessions
- class recap.api.session.SQLiteSessionStorage(db_url: str = 'sqlite:///:memory:')[source]
Bases:
objectA implementation that leverages persistent sqlite database for storing chat session information
- class Base(**kwargs: Any)[source]
Bases:
DeclarativeBase- metadata: ClassVar[MetaData] = MetaData()
Refers to the
_schema.MetaDatacollection that will be used for new_schema.Tableobjects.See also
orm_declarative_metadata
- registry: ClassVar[registry] = <sqlalchemy.orm.decl_api.registry object>
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.