professor_helper
Helper class for Professor tools.
This module contains the non-MCP business logic used by ProfessorServer so
the server can delegate tool execution through BaseMCPServer.run_tool() while
keeping tool registration focused on MCP wiring.
ProfessorHelper
Encapsulate Professor tool implementations behind the run_tool contract.
Attributes:
| Name | Type | Description |
|---|---|---|
llm_client |
Configured OpenAI-compatible client used for image analysis, or None when LLM access is unavailable. |
|
model |
Model name used for image-analysis requests, or None when no LLM client is configured. |
Methods:
| Name | Description |
|---|---|
launch_professor_gui |
Start the Professor GUI process for a YAML config. |
analyze_image_with_llm |
Submit an image and prompt to the configured multimodal LLM. |
Source code in src/mada_tools/surrogate/professor/professor_helper.py
__init__()
Initialize the helper with optional LLM client configuration.
The helper attempts to construct an OpenAI-compatible client from the environment. If the required API configuration is absent, image analysis remains disabled while the rest of the helper stays usable.
Source code in src/mada_tools/surrogate/professor/professor_helper.py
analyze_image_with_llm(image_path, prompt)
Use the configured LLM to analyze an image from a local path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_path
|
str
|
Path to the local image file to analyze. |
required |
prompt
|
str
|
User prompt or analysis instruction to send with the image. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A |
str
|
is either the model response or an informational message explaining |
tuple[bool, str]
|
why analysis could not be performed. |
Source code in src/mada_tools/surrogate/professor/professor_helper.py
launch_professor_gui(yaml_file)
Launch the Professor GUI for the given YAML config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaml_file
|
str
|
Path to the Professor YAML configuration file. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A |
str
|
|
tuple[bool, str]
|
started. |