Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 3 KB

AGENTS.md

File metadata and controls

62 lines (44 loc) · 3 KB

Repository Guide

This repository is mostly generated code.

Before editing or approving a PR, check the top of the file:

"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

If that marker is present, do not hand-edit the file. Changes should be made in the upstream source or generator inputs, then regenerated.

What We Own

The main hand-maintained surface is listed in .genignore.

At the repo root, that currently includes files such as:

  • pyproject.toml
  • examples/*
  • utils/*
  • src/mistralai/extra/*
  • scripts/prepare_readme.py

There are also package-specific ownership files:

  • packages/gcp/.genignore
  • packages/azure/.genignore

If a file is not listed in the relevant .genignore and it has the generated header, assume it should not be edited directly.

Custom SDK hooks are hand-written too, though the root .genignore does not list them: in src/mistralai/client/_hooks/ (and packages/*/src/mistralai/*/client/_hooks/), every file without the generated header, such as registration.py and custom_user_agent.py. Speakeasy writes registration.py once and never overwrites it (the package .genignore files also list it); sdkhooks.py, types.py and __init__.py carry the header and are regenerated.

PR Review Rule Of Thumb

  • Prefer PRs that change hand-owned files listed in .genignore.
  • Be skeptical of direct edits to generated SDK files under src/, docs/, or packages/*/src/.
  • If a generated file changed, look for the corresponding source/config change that explains the regeneration.

How a Change Reaches PyPI

This directory is the source of truth; the public mistralai/client-python repository is a copy of it. Releasing runs in the Buildkite pipeline eng-sdk-codegen in the dashboard monorepo, not in GitHub Actions:

  1. Regenerate: a weekly cron (its day and time are in the pipeline's Buildkite schedule), or a manual build with Action = regenerate, runs Speakeasy on openapi/specs/v2/ and opens the rolling dashboard pull request from sdk/regen-client-python. Review and merge it.
  2. Publish: a person starts a build with Action = publish, from the Buildkite UI or through the Buildkite API or MCP with action=publish, dry_run=false, clients=python as build meta-data. It copies this directory into a pull request on the sdk-sync branch of mistralai/client-python. Publishing never regenerates, so merge step 1 first.
  3. Merging that public pull request is the release. Its Publish MISTRALAI-SDK workflow waits for an approval from @mistralai/engineering-sdk on the publish environment (Actions run, Review deployments), then uploads to PyPI. Its GitHub release step currently fails on the org IP allow list, so the vX.Y.Z release is created by hand; the skill below has the command.

The full procedure, its options and its safety checks are in the dashboard skill openapi/.agents/skills/deploy-public-sdk/SKILL.md.