Configuration¶
Basic Options¶
from pyudskit import UDS
uds = UDS(
api_key="sk-ant-...",
model="claude-sonnet-4-20250514",
verbose=False,
)
api_key: overridesANTHROPIC_API_KEY.model: choose an Anthropic model.verbose: prints raw LLM output for debugging.
Session State¶
pyudskit tracks ECU context automatically:
Advanced Overrides¶
If you need a fresh context:
OEM Profile (Straightforward)¶
Load an OEM profile so services, DIDs, routines, and DTCs match your ECU:
from pyudskit import UDS
uds = UDS(profile="pyudskit/profiles/oem_example.json")
print(uds.list_services()) # merged with OEM services
print(uds.list_dids()) # merged with OEM DIDs
print(uds.explain_dtc("P0301")) # OEM DTC if present
You can also load a dict at runtime:
profile = {
"name": "my_ecu",
"dids": {"0xF190": {"name": "VIN", "length_bytes": 17}},
"services": {"0x27": {"name": "SecurityAccess"}},
"dtcs": {"P0301": {"name": "Cylinder 1 Misfire", "severity": "medium"}},
}
uds.load_profile(profile)
Related References¶
- API Reference → AI Client
- API Reference → Services
- API Reference → Transport
- API Reference → Async
- API Reference → CLI
- API Reference → OEM Profiles
Testing
Use the test fixtures in tests/conftest.py to mock LLM responses.