climb.common package¶
Submodules¶
climb.common.data_structures module¶
- class climb.common.data_structures.EngineConfig(*, episode_db: List[Dict[str, Any]], plan: List[str])[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.EngineParameter(*, name: str, description: str, kind: Literal['float', 'bool', 'enum', 'records'], default: str | float | bool | List[Dict] | None, enum_values: List[str] | None = None, min_value: float | None = None, max_value: float | None = None, value_set_by_static_method: str | None = None, disabled_set_by_static_method: str | None = None, enum_values_set_by_engine_config: str | None = None, disabled: bool | None = False, records_disabled_keys: List[str] | None = None)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.EngineState(*, streaming: bool, agent: Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], agent_switched: bool, agent_state: Dict[Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], Dict[str, Any]] = {}, executing_tool: str | None = None, user_message_requested: bool = False, response_kind: ResponseKind = ResponseKind.NOT_SET, tool_request: ToolCallRecord | None = None, ui_controlled: UIControlledState = UIControlledState(interaction_stage='reason', input_request=None, input_placeholder=None))[source]¶
Bases:
BaseModel- agent_state: Dict[Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], Dict[str, Any]]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property response_kind: ResponseKind¶
- response_kind_value: ResponseKind¶
- property tool_request: ToolCallRecord | None¶
- tool_request_value: ToolCallRecord | None¶
- property ui_controlled: UIControlledState¶
- ui_controlled_value: UIControlledState¶
- class climb.common.data_structures.FileInfo(*, name: str, size: float, size_units: str, modified: datetime)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.Message(**data: Any)[source]¶
Bases:
BaseModel- property engine_state: EngineState | None¶
- engine_state_value: EngineState | None¶
- incoming_tool_calls: List[ToolCallRecord] | None¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- outgoing_tool_call: ToolCallRecord | None¶
- class climb.common.data_structures.ResponseKind(value)[source]¶
Bases:
EnumAn enumeration.
- CODE_GENERATION = 4¶
- NOT_SET = 1¶
- TEXT_MESSAGE = 2¶
- TOOL_REQUEST = 3¶
- class climb.common.data_structures.Session(*, session_key: str, working_directory: str, started_at: ~datetime.datetime = datetime.datetime(2025, 12, 19, 16, 17, 18, 295716), friendly_name: str = '', engine_name: str, engine_params: ~typing.Dict[str, str | float | bool | ~typing.List[~typing.Dict]] = {}, messages: ~typing.List[~climb.common.data_structures.Message] = [], engine_state: ~climb.common.data_structures.EngineState = EngineState( streaming=False, agent='worker', agent_switched=False, agent_state={}, executing_tool=None, user_message_requested=False, response_kind=<ResponseKind.NOT_SET: 1>, tool_request=None, ui_controlled=UIControlledState( interaction_stage='reason', input_request=None, input_placeholder=None ) ), engine_config: ~climb.common.data_structures.EngineConfig = EngineConfig(episode_db=[], plan=[]), session_settings: ~climb.common.data_structures.SessionSettings = SessionSettings(show_tool_call_logs=True, show_tool_call_return=True, show_code=True, show_code_out=True, show_planning_details=False, show_full_message_history=False, show_message_history_length=15))[source]¶
Bases:
BaseModel- engine_config: EngineConfig¶
- engine_state: EngineState¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- session_settings: SessionSettings¶
- class climb.common.data_structures.SessionSettings(*, show_tool_call_logs: bool = True, show_tool_call_return: bool = True, show_code: bool = True, show_code_out: bool = True, show_planning_details: bool = False, show_full_message_history: bool = False, show_message_history_length: int = 15)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.ToolCallRecord(*, name: str, arguments: str, engine_id: str | None = None)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.UIControlledState(*, interaction_stage: Literal['reason', 'output', 'await_user_input'] = 'reason', input_request: UserInputRequest | None = None, input_placeholder: str | None = None)[source]¶
Bases:
BaseModel- input_request: UserInputRequest | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.UploadedFileAbstraction(*, name: str, content: bytes)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.UserInputRequest(*, key: str, kind: Literal['text', 'file', 'multiple_files'], description: str | None = None, extra: Dict[str, Any] = {})[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.data_structures.UserSettings(*, user_name: str = 'docs', disclaimer_shown: bool = False, default_session_settings: SessionSettings = SessionSettings(show_tool_call_logs=True, show_tool_call_return=True, show_code=True, show_code_out=True, show_planning_details=False, show_full_message_history=False, show_message_history_length=15), active_session: str | None = None)[source]¶
Bases:
BaseModel- default_session_settings: SessionSettings¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- climb.common.data_structures.create_new_session(session_name: str | None, engine_name: str, engine_params: Dict[str, str | float | bool | List[Dict]], db: DB) Session[source]¶
climb.common.disclaimer module¶
climb.common.exc module¶
CliMB exceptions.
climb.common.plan_files module¶
- climb.common.plan_files.load_plan_and_template_files(return_as: Literal['absolute_paths', 'relative_paths', 'filenames'] = 'filenames') dict[str, list[str]][source]¶
Load all .json files from TEMPLATES_DIR and PLAN_FILES_DIR.
- Parameters:
return_as – Whether to return the paths of the files instead of just the filenames. - “absolute_paths”: Return the absolute paths of the files. - “relative_paths”: Return the relative paths of the files. - “filenames”: Return the filenames only.
- Returns:
dict with keys “plan_files” and “template_plan_files”, each containing a list of .json filenames (without path, just the filename).
climb.common.serialization module¶
- climb.common.serialization.decode_enum(s: str) Enum[source]¶
Recover the module and the enum name and value from the string, instantiate the enum and return it.
- climb.common.serialization.encode_enum(obj: Enum) str[source]¶
Store the module and the enum name and value in a string separated by a slash.
- climb.common.serialization.message_from_serializable_dict(message_dict: Dict[str, Any]) Message[source]¶
- climb.common.serialization.message_to_serializable_dict(message: Message, session_path: str) Dict[str, Any][source]¶
climb.common.utils module¶
- climb.common.utils.analyze_df_modifications(df_before: DataFrame, df_after: DataFrame, row_similarity_threshold: float = 0.8) Dict[str, Any][source]¶
- climb.common.utils.attempt_imputation_match(df1: DataFrame, df2: DataFrame, nan_sentinel: Any) List[int][source]¶
- climb.common.utils.convert_size(size_bytes: float) Tuple[float, str][source]¶
Convert file size to a more readable format.
- climb.common.utils.d2m(d: Dict[str, Any], model: T) T[source]¶
d(ictionary)_to_m(odel). Convert a dictionary to a Pydantic model instance`.
- Parameters:
d (Dict[str, Any]) – The dictionary to convert.
model (pydantic.BaseModel) – The Pydantic model class to convert to.
- Returns:
The Pydantic model instance.
- Return type:
pydantic.BaseModel
- climb.common.utils.dedent(text: str) str[source]¶
Remove the same amount of leading spaces from each line of the text.
- climb.common.utils.fix_windows_path_backslashes(path: str) str[source]¶
Modify the path string for Windows with correct escape sequences. Converts single backslashes to double backslashes.
- climb.common.utils.log_messages_to_file(messages: List[Dict], tools: List[Dict] | None, metadata: Dict | None, path: str) None[source]¶
- climb.common.utils.m2d(model: Any) Dict[str, Any][source]¶
m(odel)_to_d(ictionary). Convert a Pydantic model instance to a dictionary.
- Parameters:
model (Any) – The Pydantic model instance to convert.
- Returns:
The dictionary.
- Return type:
Dict[str, Any]
- climb.common.utils.make_filename_path_safe(s: str, remove_slashes: bool = False) str[source]¶
Make a string safe to use as a path. A simple implementation, only applicable to file name, not the full path.
- climb.common.utils.replace_str_from_dict(s: str, d: Dict[str, Any]) str[source]¶
Replace all instances of keys in a string with their corresponding values. The dictionary values that are not strings will be converted to strings
str(value)before replacement.
- climb.common.utils.truncate_dict_values(d: Dict, max_len: int = 50) Dict[source]¶
Recursively truncates dictionary values whose string representation exceeds max_len characters. To be used for shorter representations of possibly large nested dictionaries.
- Parameters:
d (Dict) – Input dictionary, possibly nested.
max_len (int) – Maximum length of the string representation of the values.
- Returns:
New dictionary with possibly truncated values.
- Return type:
Dict
Module contents¶
Common data structures and functions used by climb.
- class climb.common.EngineConfig(*, episode_db: List[Dict[str, Any]], plan: List[str])[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.EngineParameter(*, name: str, description: str, kind: Literal['float', 'bool', 'enum', 'records'], default: str | float | bool | List[Dict] | None, enum_values: List[str] | None = None, min_value: float | None = None, max_value: float | None = None, value_set_by_static_method: str | None = None, disabled_set_by_static_method: str | None = None, enum_values_set_by_engine_config: str | None = None, disabled: bool | None = False, records_disabled_keys: List[str] | None = None)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.EngineState(*, streaming: bool, agent: Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], agent_switched: bool, agent_state: Dict[Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], Dict[str, Any]] = {}, executing_tool: str | None = None, user_message_requested: bool = False, response_kind: ResponseKind = ResponseKind.NOT_SET, tool_request: ToolCallRecord | None = None, ui_controlled: UIControlledState = UIControlledState(interaction_stage='reason', input_request=None, input_placeholder=None))[source]¶
Bases:
BaseModel- agent_state: Dict[Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], Dict[str, Any]]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property response_kind: ResponseKind¶
- response_kind_value: ResponseKind¶
- property tool_request: ToolCallRecord | None¶
- tool_request_value: ToolCallRecord | None¶
- property ui_controlled: UIControlledState¶
- ui_controlled_value: UIControlledState¶
- class climb.common.FileInfo(*, name: str, size: float, size_units: str, modified: datetime)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.Message(*, key: str, role: Literal['system', 'assistant', 'user', 'tool', 'code_execution'], visibility: Literal['all', 'ui_only', 'llm_only', 'llm_only_ephemeral', 'system_only'] = 'all', agent: Literal['coordinator', 'worker', 'supervisor', 'simulated_user'] = 'worker', new_reasoning_cycle: bool = False, summary_message: bool = False, text: str | None, token_counts: Dict[Literal['coordinator', 'worker', 'supervisor', 'simulated_user'], int | None] = {}, incoming_tool_calls: List[ToolCallRecord] | None = None, outgoing_tool_call: ToolCallRecord | None = None, tool_call_success: bool | None = None, tool_call_logs: str | None = None, tool_call_return: str | None = None, tool_call_user_report: List[str | Figure | Figure] | None = None, generated_code_dependencies: List[str] | None = None, generated_code: str | None = None, generated_code_success: bool | None = None, generated_code_stdout: str | None = None, generated_code_stderr: str | None = None, files_in: List[str] | None = None, files_out: List[str] | None = None, engine_state: EngineState | None = None)[source]¶
Bases:
BaseModel- property engine_state: EngineState | None¶
- engine_state_value: EngineState | None¶
- incoming_tool_calls: List[ToolCallRecord] | None¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- outgoing_tool_call: ToolCallRecord | None¶
- class climb.common.ResponseKind(value)[source]¶
Bases:
EnumAn enumeration.
- CODE_GENERATION = 4¶
- NOT_SET = 1¶
- TEXT_MESSAGE = 2¶
- TOOL_REQUEST = 3¶
- class climb.common.Session(*, session_key: str, working_directory: str, started_at: ~datetime.datetime = datetime.datetime(2025, 12, 19, 16, 17, 18, 295716), friendly_name: str = '', engine_name: str, engine_params: ~typing.Dict[str, str | float | bool | ~typing.List[~typing.Dict]] = {}, messages: ~typing.List[~climb.common.data_structures.Message] = [], engine_state: ~climb.common.data_structures.EngineState = EngineState( streaming=False, agent='worker', agent_switched=False, agent_state={}, executing_tool=None, user_message_requested=False, response_kind=<ResponseKind.NOT_SET: 1>, tool_request=None, ui_controlled=UIControlledState( interaction_stage='reason', input_request=None, input_placeholder=None ) ), engine_config: ~climb.common.data_structures.EngineConfig = EngineConfig(episode_db=[], plan=[]), session_settings: ~climb.common.data_structures.SessionSettings = SessionSettings(show_tool_call_logs=True, show_tool_call_return=True, show_code=True, show_code_out=True, show_planning_details=False, show_full_message_history=False, show_message_history_length=15))[source]¶
Bases:
BaseModel- engine_config: EngineConfig¶
- engine_state: EngineState¶
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- session_settings: SessionSettings¶
- class climb.common.ToolCallRecord(*, name: str, arguments: str, engine_id: str | None = None)[source]¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.UIControlledState(*, interaction_stage: Literal['reason', 'output', 'await_user_input'] = 'reason', input_request: UserInputRequest | None = None, input_placeholder: str | None = None)[source]¶
Bases:
BaseModel- input_request: UserInputRequest | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class climb.common.UserSettings(*, user_name: str = 'docs', disclaimer_shown: bool = False, default_session_settings: SessionSettings = SessionSettings(show_tool_call_logs=True, show_tool_call_return=True, show_code=True, show_code_out=True, show_planning_details=False, show_full_message_history=False, show_message_history_length=15), active_session: str | None = None)[source]¶
Bases:
BaseModel- default_session_settings: SessionSettings¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].