Migration 0.30x¶
Use when upgrading from a version older than these releases: 0.309.0, 0.308.0, 0.306.0, 0.305.0, 0.304.0, 0.302.0, 0.301.0 and 0.300.0.
Part of the Migration guide.
0.309.0 — other behaviour changes¶
Besides the filters key refusal (next section), 0.309.0 brings these
changes that may need an adjustment:
JobStore.reclaim_stale()returnsReclaimedJobs, notint.if await store.reclaim_stale():keeps working (__len__); code that compares against a number or adds the return reads.totalinstead.make_auth_routerthrottles login by default: 5 wrong passwords for the same email within 900 s become429. Passlogin_throttle=Falseto turn it off, or your ownAttemptThrottlefor another budget.make_prometheus_router(dependencies=[require_x_token])is refused at construction withTypeError. Usedependencies=[make_token_dependency(secret)], which reads theX-Tokenheader.- Readiness has a timeout: every
make_health_routercheck getstimeout=3.0s by default and running past it counts as a failure. A slower check needs a largertimeout=(orNone). MinIOSettingsis deprecated in favour ofStorageSettings(STORAGE_*). TheMINIO_*names are still read; setting both names of a pair to different values fails the boot. When you regeneratedocker-compose.yaml(which now writesSTORAGE_*), drop the oldMINIO_*from.envor keep both at the same value.test_session/test_databaseare deprecated: switch tomake_test_session/make_test_database(same signature).
0.309.0 — an unknown filters key raises¶
A filters key that is not a column of the model ({"usr_id": 1}) or a
suffix that is not an operator ({"user_id__bogus": 1}) used to be ignored
in silence — and with only the wrong key in the dict, delete_many and
bulk_update changed the whole table. Now every method that takes
filters, Q, BaseService, BaseController and TenantScopedRepository
raise UnknownFilterKeyException (422, code="UNKNOWN_FILTER_KEY",
details={"filter": <key>}) before any statement runs.
Who is affected: anyone who passed, on purpose or unknowingly, a key the
model cannot resolve. The most common case is a filter schema with a
non-column field (search, include_archived) forwarded whole through
get_conditions(): a request that fills that field now answers 422.
What to do¶
-
Non-column schema field: take it out of the dict before forwarding and handle it in the service.
from typing import Any from tempest_fastapi_sdk import BasePaginationFilterSchema class TicketFilterSchema(BasePaginationFilterSchema): status: str | None = None search: str | None = None def split_conditions(f: TicketFilterSchema) -> tuple[dict[str, Any], str | None]: """Separate the column filters from the free-text term.""" conditions = f.get_conditions() search = conditions.pop("search", None) return conditions, search -
Admin:
list_filter,search_fieldsand everyLens'filtersare now checked when theAdminModelis built. A wrong name becomes aValueErrorat boot (AdminModel lens 'Open' filters on keys Ticket cannot resolve: stauts); fix the name. -
Code that wanted "everything" on purpose through a nonexistent key: pass
{}(or no key), which still adds no condition.bulk_updatekeeps refusing an empty mapping.
0.308.0 — the tempest CLI became the [cli] extra¶
tempest-cli left the base package's dependencies, together with typer and
click, and moved to the new [cli] extra (which [all] also includes).
tempest-cli requires ruff>=0.8.0 at runtime: in the base, every service
adopting the SDK carried a formatter as a production dependency, and a project
pinning ruff<0.8 in its dev group could not even resolve its lock (uv lock
refused with tempest-cli>=0.4.0 depends on ruff>=0.8.0). The library —
import tempest_fastapi_sdk and everything a service imports at runtime — is
unchanged.
Who is affected: only whoever runs the tempest command without [cli]
or [all]. Without the extra the script is still installed, but it prints the
instruction and exits with code 2:
$ tempest --help
error: missing tempest_cli, typer, click. The tempest CLI needs the optional [cli] extra. Install it with:
uv add --dev "tempest-fastapi-sdk[cli]" (in a project)
uv tool install "tempest-fastapi-sdk[cli]" (as a global command)
What to do¶
-
Global CLI (
uv tool install tempest-fastapi-sdk): reinstall with the extra. -
CLI in the project (
uv run tempest check,tempest db upgradein the terminal, in CI): add the extra to the dev group. Projects generated bytempest newfrom 0.308.0 on already come that way. -
tempestinside the production image (for instance an entrypoint that runstempest db upgradebefore starting the app): the dev group does not enter an image built withuv sync --no-dev, so there the extra goes into the runtime dependencies —"tempest-fastapi-sdk[cli,...]"— or the step switches toalembic upgrade head, which does not need the CLI. -
Direct import of
tempest_fastapi_sdk.cli.main,.config,.lintor.pr_prompt, or oftempest_fastapi_sdk.cli.app/TempestConfig: without the extra it raisesImportErrorwith the same instruction. Install[cli]wherever that code runs.
If you already install [all], there is nothing to do: [all] brings [cli].
0.306.0 — single-use TOTP codes need the totp_last_step column¶
MFAMixin gained the totp_last_step column (integer, nullable), where the
SDK stores the 30-second step of the last accepted TOTP code so the same code
is refused a second time. Since it is mapped on the mixin, migrate the
database before upgrading the package: without the column every query on the
user model fails — signup and login answer 500
(no such column: <table>.totp_last_step, measured with SQLite). Projects that
do not use MFAMixin change nothing.
What to do¶
-
Generate the migration (
uv run tempest db revision -m "totp last step", oralembic revision --autogenerate) or write it by hand:import sqlalchemy as sa from alembic import op revision: str = "0306_totp_last_step" down_revision: str | None = "<the previous revision>" def upgrade() -> None: """Add the last accepted TOTP step column.""" op.add_column("users", sa.Column("totp_last_step", sa.Integer(), nullable=True)) def downgrade() -> None: """Drop the last accepted TOTP step column.""" op.drop_column("users", "totp_last_step") -
Run
uv run tempest db upgrade(oralembic upgrade head) and only then deploy the new version.
Existing rows stay NULL, which means "no code spent yet": the next valid
code is accepted and records its step.
Two behaviour changes come along, with no required step:
- A TOTP code is worth one acceptance. The code used at
confirmno longer works for the first login, nor the login code for an immediatedisable: the user waits for the next code in the app (up to 30 seconds). An automated test that reusespyotp.TOTP(secret).now()afterconfirmnow gets401; use the next step's code,pyotp.TOTP(secret).at(int(time.time()) + 30). POST /auth/mfa/verifyanswers429after five wrong codes per account in 15 minutes. The default counter lives in the process; with more than one worker, passmake_auth_router(mfa_throttle=AttemptThrottle(redis, ...))— see Attempt limit.
0.306.0 — make_logs_router refuses an empty secret¶
make_logs_router(token_secret="") raises ValueError at construction. Up
to 0.305.0 an empty secret disabled the X-Token check, and GET /logs and
DELETE /logs answered anyone. The service generated by tempest new
mounts /logs only when TOKEN_SECRET is not empty.
What to do¶
- Service in production: set
TOKEN_SECRET(for example withuv run tempest secrets init) in every environment. Without it, the app no longer starts. -
Service that must start without a secret: mount the router only when there is one, as the template does:
-
Local run that needs
/logsopen: passmake_logs_router(..., allow_unauthenticated=True). TOKEN_SECRETpadded with whitespace: the padding is now stripped before the comparison, so clients send the value without it.
0.306.0 — a download only goes inline for a safe type¶
as_attachment=False is now a request: DownloadUtils, FileStoreUtils and
AsyncMinIOClient.download_response/serve_object only answer
Content-Disposition: inline when the response type is in
INLINE_SAFE_MEDIA_TYPES. Any other — text/html, image/svg+xml,
application/octet-stream — goes out as attachment. Every download
response also carries X-Content-Type-Options, Content-Security-Policy
and Cross-Origin-Resource-Policy.
accel_redirect_response changes its default to as_attachment=True, and
with as_attachment=False only serves inline when media_type= is passed.
build_content_disposition(name, as_attachment=False) with no media_type=
returns attachment.
What to do¶
- Route that shows an image, PDF, audio or video in the browser: nothing,
if the type is on the list. In
X-Accel-Redirectmode, passmedia_type=(for exampleguess_media_type(key)), or the file becomes a download. - A call to
accel_redirect_responsethat relied oninlineby default: passas_attachment=Falseandmedia_type=. - Deployment with
STORAGE_ACCEL_REDIRECT=true: addproxy_hide_header X-Content-Type-Options;and the threeadd_header ... always;lines from the storage recipe to nginx's internallocation. nginx does not forward the headers the app sets on the empty response. - A page that embeds the download in an
<iframe>or from another site: thesandboxCSP andsame-siteCORP apply to it. Pass the value you need inheaders=— it replaces the default of the same name. build_content_disposition(..., as_attachment=False)called by hand: passmedia_type=with the response type.
0.305.0 — a deactivated account's token no longer authenticates¶
current_user_dependency() and the authenticated routes of
make_auth_router now refuse an account with is_active=False with 403
ACCOUNT_INACTIVE (or AuthExceptions.account_inactive), even while the token is still valid. Up to 0.304.0 a
deactivated account kept getting in with the token issued before, for the
whole access TTL.
What to do¶
- A route that must serve an inactive account (reactivation, data export
before closure): build the dependency with
current_user_dependency(require_active=False). - A client that handles the deactivated account under another
code: passinactive_exception=YourException. - A
get_useroverride that only raised403for an inactive account: can be removed.
0.305.0 — a password reset whose user was removed is an invalid link¶
confirm_password_reset with a token whose user no longer exists raised
NotFoundException (404). It now raises InvalidTokenException
(401 INVALID_TOKEN, or the class in AuthExceptions.invalid_token), as
activate and confirm_email_change already did: to the caller it is a link
that does not work.
What to do¶
- A client that handled
404onPOST /auth/password-reset/confirm: handle it like the expired-link error. - Code that builds
PasswordPolicyViolation(...)by hand: passcode=PasswordViolationCode.<...>, now required. Callers that only read whatcheck_password_policyreturns change nothing.
0.305.0 — signup writes the schema fields that are columns¶
make_auth_router(signup_schema=...) now sets on the row, before the
insert, every field your signup_schema adds on top of SignupSchema that is
also a column of the user model (outside SIGNUP_PROTECTED_FIELDS: id,
email, hashed_password, is_active, is_admin). Up to 0.304.0 those
fields reached the row only if on_signup copied them.
What to do¶
- An
on_signupthat only copied the fields (user.phone = payload.phone): can be removed. - A schema field named like a column that you transform before storing
(normalizing a phone, say):
on_signupstill runs afterwards, in the same transaction, and overwrites the value. But uniqueness is checked at the insert, against the raw value — if that matters, normalize in a validator on the schema itself. - A schema field named like a column that must not reach the row: rename the field.
0.304.0 — the Google Sheets CSV reader has a limit by default¶
read_google_sheet and read_google_sheet_as gained max_bytes and
max_rows, on by default: an export over 10 MiB
(DEFAULT_GOOGLE_CSV_MAX_DOWNLOAD_BYTES) or with more than 100,000 data rows
(DEFAULT_XLSX_MAX_ROWS) now raises SpreadsheetTooLargeError (413,
SPREADSHEET_TOO_LARGE). Up to 0.303.2 the same tab was read whole, with no
ceiling. Details in A tab that is too large.
What changes¶
- A tab with 100,001 data rows: it used to return all 100,001; it now
raises
SpreadsheetTooLargeErrorwithdetails == {"limit": "rows", "max": 100000, "actual": 100001, "sheet": None, "row": 100002}. - An export over 10 MiB: the transfer is closed and the same error is
raised with
details["limit"] == "download_bytes". - A blank row does not count toward
max_rows.
What to do¶
- A tab you know is large and whose source you trust: raise the limit
(
max_rows=500_000,max_bytes=50 * 1024 * 1024) or turn it off withmax_rows=None/max_bytes=None. - An endpoint that lets the exception through: the error is already an
AppExceptionwith413; nothing to do if you use the SDK'sregister_exception_handlers.
0.304.0 — SQLite enforces foreign keys¶
Every SQLite engine AsyncDatabaseManager and create_test_engine build now
runs PRAGMA foreign_keys=ON on each connection. None did before, so SQLite
accepted what PostgreSQL refuses: a child pointing at a missing parent,
ON DELETE CASCADE deleting nothing, and add_all([child, parent]) with no
relationship() sending the child's INSERT first. Details and measurements in
Database.
What changes¶
- A test that writes a child without its parent fails with
IntegrityError: FOREIGN KEY constraint failed. It was a test that passed on SQLite and would fail on PostgreSQL. ON DELETE CASCADEdeletes the children on SQLite too.create_test_engineapplies the manager's savepoint fix: abegin_nested()that exits cleanly no longer commits the outer transaction.- The migration engine stays without FK, and the generated
env.pyrefuses a handed-over connection with FK on — see below.
What to do¶
- Seed the parent in tests. Create the referenced row before the one
that references it, and
flush()after the parent when the models have norelationship(). Do not turn FK off in the test to make it pass: the defect is the test, not the FK. -
Existing SQLite database: look for orphans before upgrading.
import sqlite3 with sqlite3.connect("app.db") as conn: for row in conn.execute("PRAGMA foreign_key_check"): print(row)Each row is
(table, rowid, parent table, FK index): the member with id 2 pointing at an organization that does not exist prints('member', 2, 'org', 0). Measured on SQLite 3.47.1: with FK on, the database opens and reads normally, anUPDATEof another column of the orphan and aDELETEof it pass; what fails is writing a key with no parent (anINSERT, or anUPDATEof the FK column to a missing parent). 3. Need to postpone it? Turn it off on the path you use — ignored on every backend other than SQLite:from sqlalchemy.ext.asyncio import AsyncEngine from tempest_fastapi_sdk import AsyncDatabaseManager from tempest_fastapi_sdk.testing import create_test_engine db: AsyncDatabaseManager = AsyncDatabaseManager( "sqlite+aiosqlite:///./app.db", sqlite_foreign_keys=False, ) engine: AsyncEngine = create_test_engine(foreign_keys=False)From the environment:
DATABASE_SQLITE_FOREIGN_KEYS=false, read byDatabaseSettings.database_kwargs(). 4. Connection shared with Alembic: if you hand anAsyncDatabaseManagerconnection toenv.py(config.attributes["connection"]), it now arrives with FK on — and batch mode rebuilding the parent table deletes theON DELETE CASCADEchildren without an error (measured with Alembic 1.19.1: 3 rows → 0). Theenv.pyalready in your repository does not refuse. Migrate on a connection fromAsyncDatabaseManager(url, sqlite_foreign_keys=False)and regenerateenv.py— step by step in Migrations.AlembicHelperandtempest db ...open their own engine, without FK, and do not change.
0.304.0 — a raw tool error no longer reaches the model¶
When an agent tool raises an exception that is not an AgentToolError,
the model now reads only tool failed: <Type> as the observation. It used to
read the exception's whole text — and the HTTPStatusError from
raise_for_status() carries the full URL: measured, the observation took
?apikey=s3cr3t to the model, which can repeat what it reads. The trace has
kept only the type since 0.300.0; now the conversation does too. Details in
Why translate the exception.
What changes¶
- The observation of a raw exception was
HTTPStatusError: Client error '401 Unauthorized' for url '...?apikey=...'and becomestool failed: HTTPStatusError. - The trace does not change: still
HTTPStatusError: the tool failed (details withheld). The log (tempest_fastapi_sdk.agents.agent) still has the whole exception. AgentToolErrordoes not change: its message reaches the model and the trace as written.expose_tool_errors=Truenow covers both sides: it hands the text to the model and the trace, with the obvious credential shapes masked (?apikey=***,Authorization: Bearer ***,postgresql://admin:***@db).
What to do¶
- A tool that relied on the model reading the raw text to correct itself
(a 404 that said "does not exist", another library's validation error)
translates the failure into an
AgentToolErrorwith the sentence the model needs to read. - A test that asserted the raw text in the observation now asserts
tool failed: <Type>— or turnsexpose_tool_errors=Trueon for that agent. - To get the text back to the model in development,
Agent(..., expose_tool_errors=True). It also writes the text to the trace, which the HTTP router serves: do not turn it on behind an open endpoint.
0.302.0 — a composite constraint carries every column in its name¶
NAMING_CONVENTION named unique constraints, indexes and foreign keys after
the first column only, so UniqueConstraint("title") and
UniqueConstraint("title", "release_year") both became uq_books_title.
PostgreSQL refuses the CREATE TABLE (relation "uq_books_title" already
exists); SQLite accepts both, which is why the defect passed on the test
database. The convention now uses every column.
What changes¶
- A composite constraint is renamed. A
uq,ixorfkover more than one column carries all of them in the name:uq_books_title→uq_books_title_release_year,ix_books_author→ix_books_author_books_title,fk_books_tenant_id_authors→fk_books_tenant_id_author_id_authors. - A single-column name does not change, and neither do
pkandck. - The SDK itself has two. The model from
make_user_oauth_account_modelrenamesuq_<table>_provider→uq_<table>_provider_subjectanduq_<table>_user_id→uq_<table>_user_id_provider. - The
constraintfromparse_integrity_errorfollows the database. After theRENAME, PostgreSQL returns the new name; your own map from constraint name to error code needs the new key.
What to do¶
alembic revision --autogenerate over an old database proposes drop +
create for the composite uniques and indexes and does not see the
renamed composite FK (measured against PostgreSQL 16 and Alembic 1.19.1).
That drop fails when an FK depends on the unique. The way through is a
revision with RENAME:
-
With every model imported, generate the
RENAMEs withlegacy_constraint_renames(BaseModel.metadata). Each item is aConstraintRename(kind, table, schema, columns, old_name, new_name);statement(dialect)writes the SQL andinverse()gives thedowngrade()one. A constraint with an explicitname=is left out.from sqlalchemy import Index, UniqueConstraint from sqlalchemy.dialects import postgresql, sqlite from sqlalchemy.orm import Mapped, mapped_column from tempest_fastapi_sdk import ( BaseModel, ConstraintRename, legacy_constraint_renames, ) class BookModel(BaseModel): """Books in the catalogue.""" __tablename__ = "books" __table_args__ = ( UniqueConstraint("isbn"), UniqueConstraint("title", "release_year"), Index(None, "author", "title"), ) isbn: Mapped[str] = mapped_column() title: Mapped[str] = mapped_column() release_year: Mapped[int] = mapped_column() author: Mapped[str] = mapped_column() renames: list[ConstraintRename] = legacy_constraint_renames(BaseModel.metadata) for rename in renames: print(rename.kind, rename.old_name, "->", rename.new_name) print(rename.statement(postgresql.dialect())) try: renames[0].statement(sqlite.dialect()) except ValueError as exc: print(f"ValueError: {exc}")Output:
index ix_books_author -> ix_books_author_books_title ALTER INDEX ix_books_author RENAME TO ix_books_author_books_title unique uq_books_title -> uq_books_title_release_year ALTER TABLE books RENAME CONSTRAINT uq_books_title TO uq_books_title_release_year ValueError: ConstraintRename.statement supports postgresql, not 'sqlite'; SQLite cannot rename a constraint, so use the batch migration alembic --autogenerate rendersuq_books_isbn, a single-column unique, does not show up: its name did not change. -
Paste the statements into an empty revision and run
alembic upgrade headbefore deploying the new version. The step by step, with the full revision and itsdowngrade(), is in Database → Migrate composite constraints from the old convention. - On SQLite
statement()raisesValueError, as in the output above: SQLite cannot rename a constraint, and there the batch migration the autogenerate renders works.
To postpone
Give the composite constraint the name it already has in the database
(UniqueConstraint("title", "release_year", name="uq_books_title")): an
explicit name beats the convention, and legacy_constraint_renames leaves
the constraint out. The old convention is still available as
LEGACY_NAMING_CONVENTION.
0.301.0 — CSS, DataTable, forms, SSR and sessions¶
The release that brought the tempest-bucket admin panel's bridges into the
SDK changes behaviour in five areas a service notices. None needs a database
migration.
CSS¶
make_css_routerandcss_responsechange the defaultCache-Controlfrompublic, max-age=3600tono-cacheon the unversioned path: the browser revalidates through theETag(304, no body) before using its copy. For the long cache, linksheet.url(path), which appends?v=<version>and receivespublic, max-age=31536000, immutable. If you already passed an explicitcache_control=, nothing changes.- The
StyleSheetreset gained afont-familyonbody. A rule of your own that sets the family still wins when it comes after the reset (which is the case forapp_stylesheet'sextra=).
Details in Typed CSS.
DataTable¶
The <table> now comes inside <div class="tui-table-scroll">, so a wide
table scrolls inside its container instead of widening the page on a phone.
A selector of your own that targeted .tui-card__body > table needs to
include the wrapper.
Forms¶
- A present
help_textalways wins.{"ui": {"help_text": ""}},NoneorFalsesuppress the hint; before, it fell back to the field'sdescription. - An
UploadFilefield no longer renders as<input type="text">: it renders<input type="file">, and the form gainsenctype="multipart/form-data".
Details in Forms.
SSR¶
html_response(page) without title= uses page.document_title() instead of
raising ValueError. The error stays for a widget that is not a Page.
Sessions¶
make_session_dependency(...)returns anasyncdependency. InsideDepends(...)nothing changes; a test that called the resolver directly needs anawait.SessionAuth.user_modelistype[BaseUserModel] | None. Typed code that reads the attribute has to narrow it.SESSION_COOKIE_SAMESITEisLiteral["lax", "strict", "none"]. No value accepted before is refused now; aSettingsthat overrides the field asstrbecomes an incompatible override under mypy — override it with theLiteralor drop the override.make_session_router's logout deletes the cookie with the settings' attributes, instead of alwaysSecureandHttpOnly.
Details in Sessions.
0.300.0 — the chat attachment records who uploaded it¶
BaseMessageAttachmentModel gained the uploader_id column (nullable,
indexed). Since every concrete attachment table inherits it, migrate the
database before upgrading the package: without the column, every chat
route that builds a message answers 500 (no such column:
message_attachments.uploader_id, measured with SQLite).
What to do¶
- Generate the migration (
alembic revision --autogenerate) or write it by hand — oneop.add_column(..., sa.Column("uploader_id", sa.Uuid(), nullable=True))and oneop.create_index(...). The full file, withdowngrade(), is in the chat recipe. - Run
alembic upgrade head, and only then deploy the new version. - Record the upload through
ChatService.add_attachment(uploader_id, ...), or passuploader_id=where you already write the row by hand.
Existing rows keep uploader_id NULL and stay claimable by any sender —
the transition window. A new row with an uploader is claimed only by a
message from that uploader; anyone else gets the same 404 as for an id
that does not exist.
0.300.0 — the other breaking changes: AI, chat, metrics and migrations¶
The same release closes security and resource defects in the AI modules, and
some fixes change the contract. Walk the list and apply what you use; the
measured reason for each item is in CHANGELOG.md.
make_ai_chat_router¶
- The
user_idfield left the body — a client that still sends it does not break, the field is ignored. The memory owner now comes from a dependency:make_ai_chat_router(pipeline, current_user_id=...). A pipeline withmemory=mounted withoutcurrent_user_id=raisesValueErrorat mount time. Complete example in Long-term memory. historywith aroleother thanuser/assistantanswers422.
ContentExtractor¶
- A private host (intranet,
localhost, cloud metadata) is refused withfailed=True. To fetch from the intranet, passallow_private_networks=True. - A page above 5 MiB needs a larger
max_response_bytes=. - HTTPS through an HTTP proxy now fails closed; behind a proxy, use
allow_private_networks=Trueand leave egress control to the proxy.
New limits that answer 422¶
make_genai_routerchecksGenAIRequestLimitsbefore running the model; passlimits=GenAIRequestLimits(...)if you need more (Per-request limits).POST /imagerefusesnum_images > 1.make_vision_routerreads at most 20 MiB and 50 MP per image (max_upload_bytes=/max_image_pixels=).make_chat_routerrequirespage >= 1and1 <= page_size <= 100(max_page_size=), and the chat schemas have length caps.modelops'sPOST /predictrefuses batches above 10 000 rows (max_rows=;Noneremoves the cap).
Agent router¶
- The artifact route moved from
/runs/{index}/artifacts/{name}to/runs/{run_id}/artifacts/{name};POST /runreturns therun_id. - Without
owner=, every run is still visible to every caller — passmake_agent_router(agent, owner=...)when there is more than one user (Serving it over HTTP). - An unexpected tool error shows in the trace only as its type;
Agent(expose_tool_errors=True)restores the full text. - A custom backend implementing
ChatBackend/ToolCallingBackendgets the messages positionally and no longer has to accept**kwargs.
Chat¶
- A caller who cannot see the message gets
404where it used to get403. A sender who is still a participant keeps getting403for someone else's message.
RAG¶
addandindexon the SDK's stores and onHybridRetrieverreplace by source: pass every chunk of asourcein the same call, or its earlier batches are gone.
Metrics¶
genai_requests_totalandgenai_request_secondsgained thestatuslabel (ok/error). A{model, op}selector still matches, but each series becomes two: sum bystatusor filterstatus="ok"in queries and alerts that compare the whole series.
modelops¶
/modelreturns only the file name inpath;make_prediction_router(expose_model_path=True)restores the absolute path.[modelops]now installsnumpy.
AlembicHelper¶
- A sync method that runs
env.py, called with an event loop running (the FastAPI lifespan), raisesRuntimeError— use the_asyncpair (await helper.upgrade_async()). Theenv.pyyou already have keeps working (migrations recipe).
Other¶
RedisFactStore: a fact written before undersubject=""orsubject="_"stays under the old{prefix}:_key, and the new version writes those subjects to another key.- The private helper
genai/_lifecycle.pymoved toutils/_lifecycle.py, with no shim.