trading_agent.doctor.checks.openai_compatible_backend_check
¶
Checks that an OpenAI-compatible backend's server answers.
A 401 answer means the server is running but wants an API key, which is reported as a warning until the key is configured.
Typical usage example:
result = OpenAICompatibleBackendCheck('qwen', backend_configuration).run()
OpenAICompatibleBackendCheck
¶
Bases: DoctorCheck
Checks one backend of kind "openai_compatible".
Creates the check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend_name
|
str
|
The backend's name in trading_agent.toml. |
required |
backend_configuration
|
BackendConfiguration
|
Its settings. |
required |
Source code in src/trading_agent/doctor/checks/openai_compatible_backend_check.py
run
¶
Asks the server for its list of models.
Returns:
| Type | Description |
|---|---|
CheckResult
|
OK when it answers, a warning when it needs an API key, failed when it is unreachable. |